Types of Enterprise Java Beans by R4R Team

Types of Enterprise Java Beans:-
There are 3 types of enterprise bean in java as follows-

1- Session Beans:
A session bean encapsulates business logic that can be invoked programmatically by a client over local, remote, or web service client views. A session bean is not persistent, means its data is not saved to a database. EJB Session Beans has three types as below:

a .Stateful Session Bean:
In stateful session bean, the state of an object consists of the values of its instance variables. In a stateful session bean, the instance variables represent the state of a unique client / bean session.

b .Stateless Session Bean:
In EJB stateless session bean conversational state is not maintained with client. When a client invokes the methods of a stateless bean, the beanís instance variables may contain a state specific to that client but only for the duration of the invocation.

c .Single tone Session Bean:
A singleton session bean is instantiated once per application and exists for the whole lifecycle of the java application. A single enterprise bean instance is shared across all the applications clients and it is concurrently accessed by clients

2- Message Driven Bean (MDB):
Message Driven Beans ( MDBs ) also known as Message Beans. Message Driven Beans are business objects whose execution is triggered by messages instead of by method calls.

3 Entity Bean:
It encapsulates the state that can be persisted in the database. It is deprecated. Now, it is replaced with JPA (Java Persistent API).

Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!