Java Enterprise Connectivity: Enterprise Java Beans (EJB) – an
architecture for the development and deployment of transactional, distributed
object applications-based, server-side software components.
The concept behind
the EJB is to allow the application programmer to concentrate on business logic
and and shield him/her from complex system level services. To acheive this, the
EJB components must operate within a controlled environment called the
container. The container is responsible for all system level services such as
instance pooling, transaction handling, security, exception handling, and data
When a client application invokes a remote method on an
enterprise bean, the container first intercepts the invocation to ensure
persistence (means that its state, the values of its variables, can be perserved
across multiple invocations of a program that references the object),
transactions, and security are applied properly to every operation a client
performs on the bean. The container manages security, transactions, and
persistence automatically for the bean, so the bean developer doesn’t have to
write this type of logic into the bean code itself. The enterprise bean
developer can focus on encapsulating business rules, while the container takes
care of everything else.
Session EJB: is a nonpersistant object that implements some business
logic on the server. A client can access a Session EJB through an implemented
Remote interface. Session EJBs can either be stateful or stateless. Stateful
Session Beans exist for the duration of a single client/server session and the
client has reference to a stateful Session Bean that is potentially valid for
the lifetime of the client. However, a stateless Session Bean is not necessarily
holding reference to a particlular Session Bean. Instead, the stateless Session
Bean executes on behalf of a single client.
Entity EJB: is a persistent object that represents an object view of
information stored in a persistent data store. Each Entity EJB carries its own
identity . Entity EJBS that manage thir own persistance are called BMP Entity
Beans. Entity EJBs that delegate their persistence to the EJB container are
called CMP Entity Beans.
The container lies between the client and the bean.
To create an EJB server side component, the bean developer provides two
interfaces plus the beans implementation class. The beans are accessed by
client applications over the network through their remote and home
Remote and Home Interfaces: The remote and home interfaces
represent the bean, but the container insulates the beans from direct access
from client applications.
The Home interface represents life cycle methods of the component (create,destroy,find).
It extends the javax.ejb.EJBHome interface.
The Remote interface represent the business methods of the bean. It extends
the javax.ejb.EJBObject interface.
Sample: Session Enterprise Beans A downloadable ZIP file containing
the complete code for the home and remote interfaces of a session enterprise
Message Service Overview An introduction to the Java Message Service
API, outlining how it can be used to add asynchronous messaging to your Java
JavaBeans Sun’s product page for EJB technology.
Specification A resources page offering a download of the EJB
specification, from Sun Microsystems
Sample: Bean Implementation Class for a Session Enterprise Bean A
downloadable ZIP file containing the complete code for a session enterprise
bean’s implementation class.
Sample: Entity Beans A downloadable ZIP file containing the complete
code for a bean managed entity bean and a test client application.
Sample: Client Applications and Session Beans A downloadable ZIP
file containing the complete code for a client application that uses a
and deploy an EJB JavaPro Article
started with EJBs DeveloperWorks Course
EJB 3.0 Tutorial
No comments yet.