Knowledge Byte In this section, you will learn about:

Slides:



Advertisements
Similar presentations
12 Copyright © 2005, Oracle. All rights reserved. Implementing Business Tasks with Session EJBs.
Advertisements

11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
6/1/20151 Luca Simone Software Engineering 2 a.a. 2001/2002.
1 Softsmith Open Learning - EJB 21-Nov Enterprise Java Beans Introduction –Application ServerApplication Server –Java 2 Enterprise EditionJava.
1 James Lynn Hewlett-Packard Middleware Division EJB Architecture Design Strategies and Performance Optimizations.
Application Server Lecture Paulo Barroso Kris Carver Todd Kitterman Eric Silva.
Copyright W. Howden1 Lecture 19: Intro to O/O Components.
J2EE Security and Enterprise Java Beans Mrunal G. Dhond Department of Computing and Information Sciences Master of Science, Final Defense February 26,
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
Java Pet Store Application. Outline Introduction Introduction Information Layer Information Layer Application Layer Application Layer Infrastructure Layer.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
EJB Overview Celsina Bignoli Distributed Business Applications Server DB Client DB Server DB.
1 Session Bean Chuyên đề Lập trình Java & J2EE Chương 14 Biên soạn: Th.S Nguyễn văn Lành.
Developing and Deploying Business Components using PowerJ.
Advanced Java Session 7 New York University School of Continuing and Professional Studies.
Chemical Toxicity and Safety Information System Shuanghui Luo Ying Li Jin Xu.
Enterprise Java Beans Part I Kyungmin Cho 2001/04/10.
Container-Managed Persistence (CMP) Entity Beans Lesson 3A / Slide 1 of 42J2EE Server Components Objectives In this lesson, you will learn to: Identify.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
Presented By Pradeep K Sahu. What will be the Contents of the Seminar ? What is EJB ? EJB Architecture Types of EJB Session Entity Why EJB ? Writing a.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
Introduction to J2EE Architecture Portions by Kunal Mehta.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
Message-Driven Beans and EJB Security Lesson 4B / Slide 1 of 37 J2EE Server Components Objectives In this lesson, you will learn about: Identify features.
第十四章 J2EE 入门 Introduction What is J2EE ?
© jGuru.com Enterprise JavaBeans Fundamentals.
Collaborate Lesson 4C / Slide 1 of 22 Collaborate Knowledge Byte In this section, you will learn about: The EJB timer service Message linking in EJB 2.1.
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Session Beans Based on: Patel, Brose, Silverman, Mastering Enterprise JavaBeans 3.0.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Enterprise Java Beans N.V.RAJASEKHAR REDDY. Definition of EJB EJBs are the components that are the set of classes and interfaces deployed within a container.
Copyright © 2002 ProsoftTraining. All rights reserved. Enterprise JavaBeans.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Enterprise JavaBeans: Fundamentals. EJB Fundamentals(c)CDAC(Formerly NCST)2 Contents Introduction Technology Overview EJB Architecture EJB Specification.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Middleware Technology (J2EE/EJB) EJB Fundamentals.
Advanced Java Session 7 New York University School of Continuing and Professional Studies.
EJB Enterprise Java Beans JAVA Enterprise Edition
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
©NIIT Session Beans Lesson 1B/ Slide 1 of 37J2EE Server Components Objectives In this lesson, you will learn to: Describe the characteristics of session.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
J2EE Lecture 10: EJB 3.0 Overview
Entity Bean Chuyên đề Lập trình Java & J2EE Chương 15
Java Servlets By: Tejashri Udavant..
Introduction to J2EE Architecture
Knowledge Byte In this section, you will learn about:
Knowledge Byte In this section, you will learn about:
J2EE Application Development
Web-Services-based Systems Architecture, Design and Implementation
Introduction to Enterprise JavaBean
Distributed System Using Java 2 Enterprise Edition (J2EE)
Understanding and Designing with EJB
Services-based Systems Architecture, Design and Implementation
Luca Simone Software Engineering 2 a.a. 2001/2002
Chapter 40 Remote Method Invocation
Objectives In this lesson, you will learn to:
Understanding and Designing with EJB
Knowledge Byte In this section, you will learn about:
Chapter 46 Remote Method Invocation
Component-based Applications
Component Technology Bina Ramamurthy 2/25/2019 B.Ramamurthy.
Knowledge Byte In this section, you will learn about:
Understanding and Designing with EJB
Enterprise Java Beans.
Objectives In this lesson, you will learn about:
Presentation transcript:

Knowledge Byte In this section, you will learn about: New features in EJB 2.1 specification RMI in EJB Collaborate

New Features in EJB 2.1 Specification New features and enhancements introduced in EJB 2.1 specification are: Enhanced message-driven beans New clauses and functions in EJB Query Language (QL) EJB timer service New Web services for EJB architecture Collaborate

New Features in EJB 2.1 Specification (Contd.) Enhanced Message-Driven Beans EJB 2.1 specification allows message-driven beans to receive messages from non-JMS APIs, such as Java API for XML Messaging (JAXM), as well. You need to implement only those interfaces corresponding to the API that you are using for sending messages. For example, to receive the JAXM-compatible messages, you need to implement the javax.xml.messaging.OnewayListener or javax.xml.messaging.ReqRespListener interfaces in the message-driven bean class file. Collaborate

New Features in EJB 2.1 Specification (Contd.) New Clauses and Functions in EJB Query Language (EJB QL) are: Introduces the ORDER BY clause in EJB QL that enables you to sort the data retrieved by a database query according to a specified field. Introduces following mathematical functions that enable you to perform mathematical operations: MOD(Num1,Num2) AVG(Field) MIN(Field) MAX(Field) SUM(Field) COUNT(Field) Collaborate

New Features in EJB 2.1 Specification (Contd.) EJB Timer Service: Enables you to send notifications after scheduled time intervals to all type of beans except stateful session beans. Uses a Timer object to send notification to an enterprise bean after specified delay. The following code snippet creates a Timer object named time1 that notifies an enterprise bean after a time delay of 5 seconds: TimerService timeservice1= context.getTimerService(); Timer time1=timeservice1.createTimer(5000,”Example Timer”); Collaborate

New Features in EJB 2.1 Specification (Contd.) New Web Services For EJB Architecture are: You can declare stateless session beans as Web service endpoints to enable the stateless session beans to interact with clients, directly. Web service support in stateless session beans enables the client interfaces that are developed in various languages, such as C# and .NET, to access methods of enterprise beans directly, without using JSP and servlets. EJB 2.1 specification also enables enterprise beans to access the Web services directly. The reference to a Web service is stored in the <service-ref> tag in the deployment descriptor of the enterprise bean. Collaborate

RMI in EJB RMI: Is the technique that enables objects in one Java Virtual Machine (JVM) to invoke the methods of another object stored in another JVM. Is supported by most EJB servers as a standard feature. Is used by the enterprise applications to invoke remote methods. Enterprise beans communicate with each other and clients using RMI over IIOP. Collaborate

RMI in EJB (Contd.) The remote and home interfaces are stored at the client-end. A client calls the methods of the remote and home interfaces and these method calls are sent to the stubs on client-end. The stub marshals the parameters and calls the skeleton across the network. The skeleton demarshals the parameters and calls the methods of the EJB object. Before the release of EJB 2.0 specification, RMI was the only technique to call the methods of enterprise beans. EJB 2.0 specification has introduced local interfaces, which do not use RMI to invoke methods but can only be used when both, client and bean, are stored in the same JVM . Collaborate

From the Expert’s Desk In this section, you will learn: Best Practice on: Upgrading a Web Application by Incorporating EJB Components Tips and Tricks on: Passing a Session Bean’s Reference to Another Session Bean Optimizing the Performance of Stateless Session Beans Declaring and Accessing Session Bean Environment Properties FAQs on EJB Collaborate

Best Practices Upgrading a Web Application by Incorporating EJB Components A Web application can be upgraded to an EJB application by creating enterprise beans and interfaces. The enterprise beans are included between the Web tier and the database tier. JSP and servlets interact with clients and invoke the methods of enterprise beans to perform database operations. Collaborate

Best Practices Upgrading a Web Application by Incorporating EJB Components (Contd.) Benefits of enterprise beans are: Enterprise beans handle the business logic efficiently as compared to JSP and servlets that handle the business logic in Web applications. EJB container provides various features, such as transaction management and connection pooling that improve the performance and scalability of the application. Enterprise beans reduce network traffic. The calls between EJB components located in the same JVM are faster as they can interact using local interfaces. EJB technology secures an application by authenticating clients and defining which security roles can invoke which business methods of the enterprise bean. Collaborate

Tips and Tricks Passing a Session Bean’s Reference to Another Session Bean You can pass the reference of a session bean’s object to another session bean by using the getEJBObject() method, which returns the reference to the instance context of the session bean. The SessionContext object of a session bean contains the getEJBObject() method. Collaborate

Tips and Tricks Optimizing the Performance of Stateless Session Beans Techniques to optimize the performance of a stateless session bean are: Setting appropriate bean pool size. Caching resources using the ejbCreate() and setSessionContext() methods. Releasing resources using the ejbRemove() method. Collaborate

Tips and Tricks Declaring and Accessing Session Bean Environment Properties Environment properties: Enable you to change and modify the business logic of an application without modifying the source code of the session bean. Are represented as name and value pairs in the deployment descriptor. Are accessed using the Java Naming and Directory Interface (JNDI) Environment Naming Context (ENC). Collaborate

FAQs Why are local interfaces used to access an enterprise bean? Local interfaces enable clients to access bean methods faster than remote interfaces. Local interfaces are faster because they directly call the methods of enterprise bean rather than using the RMI technique for invoking methods. Why does the EJB specification impose certain programming restrictions in EJB? EJB container is responsible for providing various system-level services, such as network connections and thread management. As a result, you need to avoid coding these system-level services in enterprise beans. The EJB specification defines certain programming restrictions to avoid the programming of system-level services by the programmers. Collaborate

FAQs (Contd.) Which EJB component is responsible for the creation and removal of stateless session bean instances? EJB container is responsible for managing the creation and removal of stateless session bean instances in the shared pool. Is the ejb-jar.xml file EJB container-specific or is it same for all the EJB application servers? The ejb-jar.xml file is same for all EJB-compliant application servers. The various application servers may generate other vendor-specific files with the .xml extension that store the container-specific features. Collaborate

FAQs (Contd.) What is the function of the setSessionContext() method in stateless session beans? The setSessionContext() method is used to associate a session bean with a session context, which stores information, such as home object reference, transactional state, and security, about the session bean. Collaborate

Challenge The EJB container creates the _________and _______ objects. Deployment descriptor elements are specified in the ______ file. The javax.ejb.SessionBean interface extends the ___________ interface. The ejbCreate() and ejbRemove() methods are also called the _____________ methods of an enterprise bean. EJB-related classes and interfaces are present in the __________ package. Collaborate

Solutions to Challenge Home, EJB ejb-jar.xml javax.ejb.EnterpriseBean life cycle javax.ejb Collaborate