TechnoBuzz

A Techno Blog, mainly about Java

EJBs intro

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

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

 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. 

Enterprise JavaBeans Fundamentals

Developing an Entity Bean

Code
Sample: Session Enterprise Beans
A downloadable ZIP file containing
the complete code for the home and remote interfaces of a session enterprise
bean.

Java
Message Service Overview
An introduction to the Java Message Service
API, outlining how it can be used to add asynchronous messaging to your Java
enterprise applications.

Enterprise
JavaBeans
Sun’s product page for EJB technology.

EJB
Specification
A resources page offering a download of the EJB
specification, from Sun Microsystems

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

Code
Sample: Entity Beans
A downloadable ZIP file containing the complete
code for a bean managed entity bean and a test client application.

Code
Sample: Client Applications and Session Beans
A downloadable ZIP
file containing the complete code for a client application that uses a
session bean.

Develop
and deploy an EJB
JavaPro Article

Getting
started with EJBs
DeveloperWorks Course

EJB 3.0 Tutorial

Advertisements

July 18, 2004 - Posted by | EJB

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: