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).