+ All Categories
Home > Documents > Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a...

Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a...

Date post: 04-Jul-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
26
Enterprise Java Beans 1 COPMILED BY BJ
Transcript
Page 1: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Enterprise Java Beans

1COPMILED BY BJ

Page 2: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

CHAPTER 3. EJB Architecture

• Overview of EJB software architecture.• View of EJB Conversation.• Building and Deploying EJBs.• Roles in EJB.• Roles in EJB.

2COPMILED BY BJ

Page 3: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Application Server

• Application server provides Middleware Services Such as polling,Networking,Security Caching & transaction management to distributed Enterprise application.distributed Enterprise application.

3COPMILED BY BJ

Page 4: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Enterprise Java Beans• EJB provides a consistent framework for creating

distributed n-tier middleware architecture. it enables the development & deployment of component based robust, highly scalable & transactional business applications.An EJB is server side component that executes • An EJB is server side component that executes specific business logic which is deployed on Application server & provides services to local & remote client.

• Its A component model For developing object-oriented distributed enterprise-level applications

4COPMILED BY BJ

Page 5: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Advantages Of EJB• Simplifies development of small & large enterprise

application by providing standard system level services to the component from container.

• Its component based architecture promotes reusability of existing component.

• Its scalability facilitates easy addition/removal of server side resources.

• Its Business logic resides in bean component so client need to concentrate only on development of user interface

5COPMILED BY BJ

Page 6: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Advantages Of EJB• Transaction management• Platform independence• Scalable environment• Secure access• Multi-tier architecture• Multi-tier architecture• easier development process

6COPMILED BY BJ

Page 7: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Disadvantages of EJB• It has a large complicated specification• It has heavy-weighted framework.• Its difficult to code and debug• Its only suitable for highly scalable secure

transactional objecttransactional object• It has steep learning curve

7COPMILED BY BJ

Page 8: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Architecture of EJB

8COPMILED BY BJ

Page 9: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Architecture of EJB• 1) EJB SERVER

It Host EJB Containter.It provides the executionenvironment for the server component & also providesSystem Services such as Multiprocessing, load balancing,device acces,naming & transaction processing.

2) EJB Container2) EJB ContainerIt serves as an interface between EJB & outside world.

An EJB Client cannot access the bean directly however itcan access the bean through Container-Generated Method.Container can be categorized on basis of its typeSession Container contains transient,nonpersistentEJBs,Entity Container Conatins Persistent EJBs whose statesare saved between invocation.

9COPMILED BY BJ

Page 10: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Architecture of EJBThe Container host following Component -> EJB Object -: client invokes bean instance through EJB

Object it accept request from client & delegate it to Bean instance .

-> Remote interface -:it duplicate the methods of bean class hence all client access remote object through this interface

-> Home Object -: The client creates & destroy EJB object -> Home Object -: The client creates & destroy EJB object through EJB object factory called home object.

-> Home interface -: it expose the methods for creating destroying & finding bean object through Home interface.

-> Local interface -: its used instead of remote interface to make process faster for creating bean through home interface & calling through remote interface.

10COPMILED BY BJ

Page 11: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Architecture of EJB3) Enterprise beans -:-> They are JavaEE Component that implements business

logic of the application. The EJB container act as runtimeEnvironment for enterprise beans.

-> It provides System level Services such as security &transaction to its enterprise beans.

They are of three types depends on functionalityThey are of three types depends on functionality-> Session beans represent an action or a process that

executes Synchronously-> Message driven beans -: represent an action or a process

that executes asynchronously.-> Entity beans -: represents data or unique record in

database.11COPMILED BY BJ

Page 12: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Architecture of EJB4) EJB Client -: it make use of EJB beans to perform their

operation. Client locate EJB Container using JNDI theninvoke EJB beans through container.

5) Deployment DescriptorIt’s a list of properties & elements as followsIt’s a list of properties & elements as followsHome & remote interface ->bean managementBean implementation class -> lifecycle requirementJNDI name for beans ->persistent RequirementEnvironment variablesTransactional attributesSecurity requirement such access right/roles 12COPMILED BY BJ

Page 13: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

View of EJB Conversion (bean invocation process)

13COPMILED BY BJ

Page 14: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

View of EJB Conversion• EJB is a Server side component to get the services

hosted by EJB, the client has to communicate with the ejb Component. To converse with Enterprise beans the client has to perform foll.task

1)Locating the enterprise Bean -:• its done through naming service that associates a

symbolic name with object a DNS maps the symbolic name with object a DNS maps the symbolic m/c name to ip.

• when client queries DNS server for a particular bean object the IP address is returned if the DNS server can resolve the same. otherwise Client queries for another DNS for the same object. Once server is able to resolve the name it returns address to client.

14COPMILED BY BJ

Page 15: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

• There two ways used by client to find a beans• 1) Using Java Naming & Directory Interface

java client uses JNDI to lookup EJB component JNDI call returns a ref to obj implementng EJB component.

• 2) Using CORBA’S Common object • 2) Using CORBA’S Common object service(cos)

naming service of COS can also be used for this purpose.

15COPMILED BY BJ

Page 16: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

b) Accessing BeanThe look method in the naming service returns a

refrence to the home object that implements a home interface of the EJB component. The client then uses the home interface to lookup for existing ejb instances if no such instances is available then new one is createdis available then new one is created

This lookup method returns a refrence to the ejb object remote interface.the client then uses this intrface to interact with the EJB object in the server.

16COPMILED BY BJ

Page 17: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

c)Calling bean’ methodOnce the client obtain the refrence of the

remote object it can then invoke the public methods on the remote ejb object

d) Destroying BeanWhen the client has completed its interaction When the client has completed its interaction

with the remote enterprise bean it invoke the remove() on the home interface or on the objects remote interface. This method implication on diffrent types of beans

17COPMILED BY BJ

Page 18: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

a)When remove() method is invokes on stateful session beans the container can discard it and free the space occupied by it.

b) When remove() method is invokes on stateless session beans the simply returns the instance in to the pool

c) When remove() method is invokes on Entity beans it removes the underlying object from persistence Storage.

18COPMILED BY BJ

Page 19: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

ROLES IN EJB

19COPMILED BY BJ

Page 20: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

ROLES IN EJB• To have an ejb deployed and running needs more

than an application server and components.parties associated with EJB development and deployment as shown in fig.

• 1)Bean providerHe supplies the business componetnts that can be He supplies the business componetnts that can be assembled in to an enterprise application each business component is an individual Entity tha t can perform its task

• 2)Application asemblerHe is responsible for integrating the component

20COPMILED BY BJ

Page 21: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

To develop the enterprise application. he may also need to provide user interface client program he is analogous to system integrator

• 3)EJB deployerHe configures the security ,transactions and the performance of the system this is essential to install the application in application server he receicves the EJB-JAR files and install it in receicves the EJB-JAR files and install it in container.He is like System Administrator.

• 4)System AdministratorHe is responsible for maintaining and monitoring the deployed system he uses monitoring and mangement tools for this purpose.

21COPMILED BY BJ

Page 22: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

• 5)EJB Container/Server providerAn ejb server provider provides services to the

ejb container which provide services to an enterprise bean he supplies the ejb container and the run time environment for the beans.also provides middleware services to the component and manages them.6)Tool vendors• 6)Tool vendorsThey supply IDEs to facilate the rapid modeling building and debuging of the components some e.g of such tools are Rational rose modeling,Eclipse for buildng application and junit for testing.

22COPMILED BY BJ

Page 23: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

JAVA Beans vs Enterprise Java Beans1)JavaBeans may be visible or non-visible at runtime.2)JavaBeans are intended to be local to a single process and are

primarily intended to run on the client side. Although one candevelop server-side JavaBeans, it is far easier to develop them usingthe EJB specification instead.

3)JavaBeans is a component technology to create generic Javacomponents that can be composed together into applets andapplications.applications.

4)JavaBeans have an external interface called the properties interface,which allows a builder tool to interpret the functionality of the bean.

5)JavaBeans may have BeanInfo classes, property editors or Customizers6)JavaBeans have no types.7)No explicit support exists for transactions in JavaBeans.8)Component bridges are available for JavaBeans.9) JavaBeans is a framework for client-side Java components 23COPMILED BY BJ

Page 24: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

JAVA Beans vs Enterprise Java Beans1)An EJB is a no visual, remote object. 2)EJB's are remotely executable components or business objects that can be

deployed only on the server. 3)Even though EJB is a component technology, it neither builds upon nor

extends the original JavaBean specification. 4)EJBs have a deployment descriptor that describes its functionality to an

external builder tool or IDE 5)EJB's have no concept of BeanInfo classes, property editors or customizers 5)EJB's have no concept of BeanInfo classes, property editors or customizers

and provide no additional information other than that described in the deployment descriptor.

6)EJBs are of three types - session beans ,message driven beans and entity beans.

7)EJB's may be transactional and the EJB servers provide transactional support. 8)An EJB cannot be deployed as an ActiveX control because ActiveX controls

are intended to run at the Client side and EJB's are server side components. 9) Enterprise JavaBeans is a framework for building and deploying server-side

Java components 24COPMILED BY BJ

Page 25: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

JAVA Beans vs Enterprise Java Beans• Java bean uses Single tier architecture While EJB

uses Multi tier architecture• Conceptually both are related because both are

components but their specifications are different. The specifications do not build on each other or rely on each othereach other or rely on each other

25COPMILED BY BJ

Page 26: Enterprise Java Beans - Bhushan Jadhav and PPTs/CHAPTER 3 Enterp… · • EJB provides a consistent framework for creating distributed n-tier middleware architecture. it enables

Thank youThank you

26COPMILED BY BJ


Recommended