<s>
Jakarta	B-Language
Enterprise	I-Language
Beans	I-Language
(	O
EJB	B-Language
;	O
formerly	O
Enterprise	B-Language
JavaBeans	I-Language
)	O
is	O
one	O
of	O
several	O
Java	B-Language
APIs	I-Language
for	O
modular	O
construction	O
of	O
enterprise	B-Application
software	I-Application
.	O
</s>
<s>
EJB	B-Language
is	O
a	O
server-side	B-Application
software	O
component	O
that	O
encapsulates	B-Application
business	B-Architecture
logic	I-Architecture
of	O
an	O
application	O
.	O
</s>
<s>
An	O
EJB	B-Language
web	B-Language
container	I-Language
provides	O
a	O
runtime	B-Device
environment	I-Device
for	O
web	O
related	O
software	O
components	O
,	O
including	O
computer	O
security	O
,	O
Java	B-Language
servlet	O
lifecycle	O
management	O
,	O
transaction	B-General_Concept
processing	I-General_Concept
,	O
and	O
other	O
web	O
services	O
.	O
</s>
<s>
The	O
EJB	B-Language
specification	O
is	O
a	O
subset	O
of	O
the	O
Java	B-Language
EE	I-Language
specification	O
.	O
</s>
<s>
The	O
EJB	B-Language
specification	O
was	O
originally	O
developed	O
in	O
1997	O
by	O
IBM	O
and	O
later	O
adopted	O
by	O
Sun	O
Microsystems	O
(	O
EJB	B-Language
1.0	O
and	O
1.1	O
)	O
in	O
1999	O
and	O
enhanced	O
under	O
the	O
Java	B-Language
Community	I-Language
Process	I-Language
as	O
(	O
EJB	B-Language
2.0	O
)	O
,	O
(	O
EJB	B-Language
2.1	O
)	O
,	O
(	O
EJB	B-Language
3.0	O
)	O
,	O
(	O
EJB	B-Language
3.1	O
)	O
and	O
(	O
EJB	B-Language
3.2	O
)	O
.	O
</s>
<s>
The	O
EJB	B-Language
specification	O
provides	O
a	O
standard	O
way	O
to	O
implement	O
the	O
server-side	B-Application
(	O
also	O
called	O
"	O
back-end	B-Architecture
"	O
)	O
'	O
business	O
 '	O
software	O
typically	O
found	O
in	O
enterprise	B-Application
applications	I-Application
(	O
as	O
opposed	O
to	O
'	O
front-end	B-Architecture
'	O
user	B-Application
interface	I-Application
software	O
)	O
.	O
</s>
<s>
Jakarta	B-Language
Enterprise	I-Language
Beans	I-Language
is	O
intended	O
to	O
handle	O
such	O
common	O
concerns	O
as	O
persistence	B-Application
,	O
transactional	O
integrity	O
and	O
security	O
in	O
a	O
standard	O
way	O
,	O
leaving	O
programmers	O
free	O
to	O
concentrate	O
on	O
the	O
particular	O
parts	O
of	O
the	O
enterprise	B-Application
software	I-Application
at	O
hand	O
.	O
</s>
<s>
The	O
EJB	B-Language
specification	O
details	O
how	O
an	O
application	B-Application
server	I-Application
provides	O
the	O
following	O
responsibilities	O
:	O
</s>
<s>
Additionally	O
,	O
the	O
Jakarta	B-Language
Enterprise	I-Language
Beans	I-Language
specification	O
defines	O
the	O
roles	O
played	O
by	O
the	O
EJB	B-Language
container	I-Language
and	O
the	O
EJBs	B-Language
as	O
well	O
as	O
how	O
to	O
deploy	O
the	O
EJBs	B-Language
in	O
a	O
container	O
.	O
</s>
<s>
Note	O
that	O
the	O
EJB	B-Language
specification	O
does	O
not	O
detail	O
how	O
an	O
application	B-Application
server	I-Application
provides	O
persistence	B-Application
(	O
a	O
task	O
delegated	O
to	O
the	O
JPA	O
specification	O
)	O
,	O
but	O
instead	O
details	O
how	O
business	B-Architecture
logic	I-Architecture
can	O
easily	O
integrate	O
with	O
the	O
persistence	B-Application
services	O
offered	O
by	O
the	O
application	B-Application
server	I-Application
.	O
</s>
<s>
Businesses	O
found	O
that	O
using	O
EJBs	B-Language
to	O
encapsulate	O
business	B-Architecture
logic	I-Architecture
brought	O
a	O
performance	O
penalty	O
.	O
</s>
<s>
This	O
is	O
because	O
the	O
original	O
specification	O
allowed	O
only	O
for	O
remote	O
method	B-Language
invocation	O
through	O
CORBA	B-Architecture
(	O
and	O
optionally	O
other	O
protocols	O
)	O
,	O
even	O
though	O
the	O
large	O
majority	O
of	O
business	O
applications	O
actually	O
do	O
not	O
require	O
this	O
distributed	B-Architecture
computing	I-Architecture
functionality	O
.	O
</s>
<s>
The	O
EJB	B-Language
2.0	O
specification	O
addressed	O
this	O
concern	O
by	O
adding	O
the	O
concept	O
of	O
local	O
interfaces	O
which	O
could	O
be	O
called	O
directly	O
without	O
performance	O
penalties	O
by	O
applications	O
that	O
were	O
not	O
distributed	O
over	O
multiple	O
servers	O
.	O
</s>
<s>
The	O
EJB	B-Language
3.0	O
specification	O
(	O
JSR	B-Language
220	I-Language
)	O
was	O
a	O
departure	O
from	O
its	O
predecessors	O
,	O
following	O
a	O
new	O
light-weight	O
paradigm	O
.	O
</s>
<s>
EJB	B-Language
3.0	O
shows	O
an	O
influence	O
from	O
Spring	B-Application
in	O
its	O
use	O
of	O
plain	O
Java	B-Language
objects	O
,	O
and	O
its	O
support	O
for	O
dependency	B-Library
injection	I-Library
to	O
simplify	O
configuration	O
and	O
integration	O
of	O
heterogeneous	O
systems	O
.	O
</s>
<s>
EJB	B-Language
3.0	O
along	O
with	O
the	O
other	O
version	O
of	O
the	O
EJB	B-Language
can	O
be	O
integrated	O
with	O
MuleSoft-v4	O
using	O
MuleSoft	B-General_Concept
certified	O
.	O
</s>
<s>
Gavin	O
King	O
,	O
the	O
creator	O
of	O
Hibernate	O
,	O
participated	O
in	O
the	O
EJB	B-Language
3.0	O
process	O
and	O
is	O
an	O
outspoken	O
advocate	O
of	O
the	O
technology	O
.	O
</s>
<s>
Many	O
features	O
originally	O
in	O
Hibernate	O
were	O
incorporated	O
in	O
the	O
Java	B-Language
Persistence	I-Language
API	I-Language
,	O
the	O
replacement	O
for	O
entity	B-Language
beans	I-Language
in	O
EJB	B-Language
3.0	O
.	O
</s>
<s>
The	O
EJB	B-Language
3.0	O
specification	O
relies	O
heavily	O
on	O
the	O
use	O
of	O
annotations	B-Language
(	O
a	O
feature	O
added	O
to	O
the	O
Java	B-Language
language	I-Language
with	O
its	O
5.0	O
release	O
)	O
and	O
convention	B-Application
over	I-Application
configuration	I-Application
to	O
enable	O
a	O
much	O
less	O
verbose	O
coding	O
style	O
.	O
</s>
<s>
Accordingly	O
,	O
in	O
practical	O
terms	O
EJB	B-Language
3.0	O
is	O
much	O
more	O
lightweight	O
and	O
nearly	O
a	O
completely	O
new	O
API	O
,	O
bearing	O
little	O
resemblance	O
to	O
the	O
previous	O
EJB	B-Language
specifications	O
.	O
</s>
<s>
The	O
following	O
shows	O
a	O
basic	O
example	O
of	O
what	O
an	O
EJB	B-Language
looks	O
like	O
in	O
code	O
:	O
</s>
<s>
The	O
above	O
defines	O
a	O
service	O
class	O
for	O
persisting	O
a	O
Customer	O
object	O
(	O
via	O
O/R	B-General_Concept
mapping	I-General_Concept
)	O
.	O
</s>
<s>
The	O
EJB	B-Language
takes	O
care	O
of	O
managing	O
the	O
persistence	B-Application
context	O
and	O
the	O
addCustomer( )	O
method	B-Language
is	O
transactional	O
and	O
thread-safe	O
by	O
default	O
.	O
</s>
<s>
As	O
demonstrated	O
,	O
the	O
EJB	B-Language
focuses	O
only	O
on	O
business	B-Architecture
logic	I-Architecture
and	O
persistence	B-Application
and	O
knows	O
nothing	O
about	O
any	O
particular	O
presentation	O
.	O
</s>
<s>
Such	O
an	O
EJB	B-Language
can	O
be	O
used	O
by	O
a	O
class	O
in	O
e.g.	O
</s>
<s>
The	O
above	O
defines	O
a	O
JavaServer	B-Language
Faces	I-Language
(	O
JSF	O
)	O
backing	O
bean	O
in	O
which	O
the	O
EJB	B-Language
is	O
injected	O
by	O
means	O
of	O
the	O
@EJB	O
annotation	O
.	O
</s>
<s>
Its	O
addCustomer	O
method	B-Language
is	O
typically	O
bound	O
to	O
some	O
UI	O
component	O
,	O
such	O
as	O
a	O
button	O
.	O
</s>
<s>
Contrary	O
to	O
the	O
EJB	B-Language
,	O
the	O
backing	O
bean	O
does	O
not	O
contain	O
any	O
business	B-Architecture
logic	I-Architecture
or	O
persistence	B-Application
code	O
,	O
but	O
delegates	O
such	O
concerns	O
to	O
the	O
EJB	B-Language
.	O
</s>
<s>
The	O
backing	O
bean	O
does	O
know	O
about	O
a	O
particular	O
presentation	O
,	O
of	O
which	O
the	O
EJB	B-Language
had	O
no	O
knowledge	O
.	O
</s>
<s>
An	O
EJB	B-Language
container	I-Language
holds	O
two	O
major	O
types	O
of	O
beans	O
:	O
</s>
<s>
Session	B-Language
Beans	I-Language
that	O
can	O
be	O
either	O
"	O
Stateful	B-Application
"	O
,	O
"	O
Stateless	O
"	O
or	O
"	O
Singleton	O
"	O
and	O
can	O
be	O
accessed	O
via	O
either	O
a	O
Local	O
(	O
same	O
JVM	B-Language
)	O
or	O
Remote	O
(	O
different	O
JVM	B-Language
)	O
interface	O
or	O
directly	O
without	O
an	O
interface	O
,	O
in	O
which	O
case	O
local	O
semantics	O
apply	O
.	O
</s>
<s>
All	O
session	B-Language
beans	I-Language
support	O
asynchronous	O
execution	O
for	O
all	O
views	O
(	O
local/remote/no	O
-interface	O
)	O
.	O
</s>
<s>
MDBs	O
also	O
support	O
asynchronous	O
execution	O
,	O
but	O
via	O
a	O
messaging	B-Architecture
paradigm	O
.	O
</s>
<s>
Stateful	B-Language
Session	I-Language
Beans	I-Language
are	O
business	O
objects	O
having	O
state	B-Application
:	O
that	O
is	O
,	O
they	O
keep	O
track	O
of	O
which	O
calling	O
client	O
they	O
are	O
dealing	O
with	O
throughout	O
a	O
session	O
and	O
thus	O
access	O
to	O
the	O
bean	O
instance	O
is	O
strictly	O
limited	O
to	O
only	O
one	O
client	O
at	O
a	O
time	O
.	O
</s>
<s>
If	O
concurrent	B-Operating_System
access	I-Operating_System
to	O
a	O
single	O
bean	O
is	O
attempted	O
anyway	O
the	O
container	O
serializes	O
those	O
requests	O
,	O
but	O
via	O
the	O
@AccessTimeout	O
annotation	O
the	O
container	O
can	O
instead	O
throw	O
an	O
exception	O
.	O
</s>
<s>
Stateful	B-Language
session	I-Language
beans	I-Language
 '	O
state	B-Application
may	O
be	O
persisted	O
(	O
passivated	O
)	O
automatically	O
by	O
the	O
container	O
to	O
free	O
up	O
memory	O
after	O
the	O
client	O
has	O
n't	O
accessed	O
the	O
bean	O
for	O
some	O
time	O
.	O
</s>
<s>
The	O
JPA	O
extended	O
persistence	B-Application
context	O
is	O
explicitly	O
supported	O
by	O
Stateful	B-Language
Session	I-Language
Beans	I-Language
.	O
</s>
<s>
Checking	O
out	O
in	O
a	O
web	O
store	O
might	O
be	O
handled	O
by	O
a	O
stateful	B-Language
session	I-Language
bean	I-Language
that	O
would	O
use	O
its	O
state	B-Application
to	O
keep	O
track	O
of	O
where	O
the	O
customer	O
is	O
in	O
the	O
checkout	O
process	O
,	O
possibly	O
holding	O
locks	O
on	O
the	O
items	O
the	O
customer	O
is	O
purchasing	O
(	O
from	O
a	O
system	O
architecture	O
's	O
point	O
of	O
view	O
,	O
it	O
would	O
be	O
less	O
ideal	O
to	O
have	O
the	O
client	O
manage	O
those	O
locks	O
)	O
.	O
</s>
<s>
Stateless	B-Language
Session	I-Language
Beans	I-Language
are	O
business	O
objects	O
that	O
do	O
not	O
have	O
state	B-Application
associated	O
with	O
them	O
.	O
</s>
<s>
However	O
,	O
access	O
to	O
a	O
single	O
bean	O
instance	O
is	O
still	O
limited	O
to	O
only	O
one	O
client	O
at	O
a	O
time	O
,	O
concurrent	B-Operating_System
access	I-Operating_System
to	O
the	O
bean	O
is	O
prohibited	O
.	O
</s>
<s>
If	O
concurrent	B-Operating_System
access	I-Operating_System
to	O
a	O
single	O
bean	O
is	O
attempted	O
,	O
the	O
container	O
simply	O
routes	O
each	O
request	O
to	O
a	O
different	O
instance	O
.	O
</s>
<s>
This	O
makes	O
a	O
stateless	B-Language
session	I-Language
bean	I-Language
automatically	O
thread-safe	O
.	O
</s>
<s>
Instance	O
variables	O
can	O
be	O
used	O
during	O
a	O
single	O
method	B-Language
call	I-Language
from	O
a	O
client	O
to	O
the	O
bean	O
,	O
but	O
the	O
contents	O
of	O
those	O
instance	O
variables	O
are	O
not	O
guaranteed	O
to	O
be	O
preserved	O
across	O
different	O
client	O
method	B-Language
calls	I-Language
.	O
</s>
<s>
Instances	O
of	O
Stateless	B-Language
Session	I-Language
beans	I-Language
are	O
typically	O
pooled	O
.	O
</s>
<s>
If	O
a	O
second	O
client	O
accesses	O
a	O
specific	O
bean	O
right	O
after	O
a	O
method	B-Language
call	I-Language
on	O
it	O
made	O
by	O
a	O
first	O
client	O
has	O
finished	O
,	O
it	O
might	O
get	O
the	O
same	O
instance	O
.	O
</s>
<s>
The	O
lack	O
of	O
overhead	O
to	O
maintain	O
a	O
conversation	O
with	O
the	O
calling	O
client	O
makes	O
them	O
less	O
resource-intensive	O
than	O
stateful	B-Application
beans	O
.	O
</s>
<s>
A	O
user	O
of	O
a	O
website	O
clicking	O
on	O
a	O
"	O
keep	O
me	O
informed	O
of	O
future	O
updates	O
"	O
box	O
may	O
trigger	O
a	O
call	O
to	O
an	O
asynchronous	O
method	B-Language
of	O
the	O
session	B-Language
bean	I-Language
to	O
add	O
the	O
user	O
to	O
a	O
list	O
in	O
the	O
company	O
's	O
database	O
(	O
this	O
call	O
is	O
asynchronous	O
because	O
the	O
user	O
does	O
not	O
need	O
to	O
wait	O
to	O
be	O
informed	O
of	O
its	O
success	O
or	O
failure	O
)	O
.	O
</s>
<s>
Fetching	O
multiple	O
independent	O
pieces	O
of	O
data	O
for	O
a	O
website	O
,	O
like	O
a	O
list	O
of	O
products	O
and	O
the	O
history	O
of	O
the	O
current	O
user	O
might	O
be	O
handled	O
by	O
asynchronous	O
methods	O
of	O
a	O
session	B-Language
bean	I-Language
as	O
well	O
(	O
these	O
calls	O
are	O
asynchronous	O
because	O
they	O
can	O
execute	O
in	O
parallel	B-Operating_System
that	O
way	O
,	O
which	O
potentially	O
increases	O
performance	O
)	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
the	O
asynchronous	O
method	B-Language
will	O
return	O
a	O
instance	O
.	O
</s>
<s>
Singleton	O
Session	B-Language
Beans	I-Language
are	O
business	O
objects	O
having	O
a	O
global	O
shared	O
state	B-Application
within	O
a	O
JVM	B-Language
.	O
</s>
<s>
Concurrent	B-Operating_System
access	I-Operating_System
to	O
the	O
one	O
and	O
only	O
bean	O
instance	O
can	O
be	O
controlled	O
by	O
the	O
container	O
(	O
Container-managed	O
concurrency	B-Architecture
,	O
CMC	O
)	O
or	O
by	O
the	O
bean	O
itself	O
(	O
Bean-managed	O
concurrency	B-Architecture
,	O
BMC	O
)	O
.	O
</s>
<s>
CMC	O
can	O
be	O
tuned	O
using	O
the	O
@Lock	O
annotation	O
,	O
that	O
designates	O
whether	O
a	O
read	O
lock	O
or	O
a	O
write	O
lock	O
will	O
be	O
used	O
for	O
a	O
method	B-Language
call	I-Language
.	O
</s>
<s>
Additionally	O
,	O
Singleton	O
Session	B-Language
Beans	I-Language
can	O
explicitly	O
request	O
to	O
be	O
instantiated	O
when	O
the	O
EJB	B-Language
container	I-Language
starts	O
up	O
,	O
using	O
the	O
@Startup	O
annotation	O
.	O
</s>
<s>
Loading	O
a	O
global	O
daily	O
price	O
list	O
that	O
will	O
be	O
the	O
same	O
for	O
every	O
user	O
might	O
be	O
done	O
with	O
a	O
singleton	O
session	B-Language
bean	I-Language
,	O
since	O
this	O
will	O
prevent	O
the	O
application	O
having	O
to	O
do	O
the	O
same	O
query	O
to	O
a	O
database	O
over	O
and	O
over	O
again	O
...	O
</s>
<s>
Message	O
Driven	O
Beans	O
are	O
business	O
objects	O
whose	O
execution	O
is	O
triggered	O
by	O
messages	O
instead	O
of	O
by	O
method	B-Language
calls	I-Language
.	O
</s>
<s>
The	O
Message	O
Driven	O
Bean	O
is	O
used	O
among	O
others	O
to	O
provide	O
a	O
high	O
level	O
ease-of-use	O
abstraction	O
for	O
the	O
lower	O
level	O
JMS	B-Language
(	O
Java	B-Language
Message	I-Language
Service	I-Language
)	O
specification	O
.	O
</s>
<s>
It	O
may	O
subscribe	O
to	O
JMS	B-Language
message	O
queues	O
or	O
message	O
topics	O
,	O
which	O
typically	O
happens	O
via	O
the	O
activationConfig	O
attribute	O
of	O
the	O
@MessageDriven	O
annotation	O
.	O
</s>
<s>
They	O
were	O
added	O
in	O
EJB	B-Language
to	O
allow	O
event-driven	O
processing	O
.	O
</s>
<s>
Unlike	O
session	B-Language
beans	I-Language
,	O
an	O
MDB	O
does	O
not	O
have	O
a	O
client	O
view	O
(	O
Local/Remote/No	O
-interface	O
)	O
,	O
i.e.	O
</s>
<s>
An	O
MDB	O
just	O
listens	O
for	O
any	O
incoming	O
message	O
on	O
,	O
for	O
example	O
,	O
a	O
JMS	B-Language
queue	O
or	O
topic	O
and	O
processes	O
them	O
automatically	O
.	O
</s>
<s>
Only	O
JMS	B-Language
support	O
is	O
required	O
by	O
the	O
Java	B-Language
EE	I-Language
spec	O
,	O
but	O
Message	O
Driven	O
Beans	O
can	O
support	O
other	O
messaging	B-Architecture
protocols	O
.	O
</s>
<s>
Since	O
session	B-Language
beans	I-Language
can	O
also	O
be	O
synchronous	O
or	O
asynchronous	O
,	O
the	O
prime	O
difference	O
between	O
session	O
-	O
and	O
message	O
driven	O
beans	O
is	O
not	O
the	O
synchronicity	O
,	O
but	O
the	O
difference	O
between	O
(	O
object	O
oriented	O
)	O
method	B-Language
calling	O
and	O
messaging	B-Architecture
.	O
</s>
<s>
Sending	O
a	O
configuration	O
update	O
to	O
multiple	O
nodes	O
might	O
be	O
done	O
by	O
sending	O
a	O
JMS	B-Language
message	O
to	O
a	O
'	O
message	O
topic	O
 '	O
and	O
could	O
be	O
handled	O
by	O
a	O
Message	O
Driven	O
Bean	O
listening	O
to	O
this	O
topic	O
(	O
the	O
message	O
paradigm	O
is	O
used	O
here	O
since	O
the	O
sender	O
does	O
not	O
need	O
to	O
know	O
the	O
number	O
of	O
consumers	O
,	O
their	O
location	O
,	O
or	O
even	O
their	O
exact	O
type	O
)	O
.	O
</s>
<s>
Submitting	O
a	O
job	O
to	O
a	O
work	O
cluster	O
might	O
be	O
done	O
by	O
sending	O
a	O
JMS	B-Language
message	O
to	O
a	O
'	O
message	O
queue	O
 '	O
and	O
could	O
also	O
be	O
handled	O
by	O
a	O
Message	O
Driven	O
Bean	O
,	O
but	O
this	O
time	O
listening	O
to	O
a	O
queue	O
(	O
the	O
message	O
paradigm	O
and	O
the	O
queue	O
is	O
used	O
,	O
since	O
the	O
sender	O
does	O
n't	O
have	O
to	O
care	O
which	O
worker	O
executes	O
the	O
job	O
,	O
but	O
it	O
does	O
need	O
assurance	O
that	O
a	O
job	O
is	O
only	O
executed	O
once	O
)	O
.	O
</s>
<s>
Since	O
Java	B-Language
EE	I-Language
does	O
n't	O
know	O
about	O
Quartz	O
by	O
default	O
,	O
a	O
JCA	B-Language
resource	B-Language
adapter	I-Language
would	O
be	O
needed	O
and	O
the	O
MDB	O
would	O
be	O
annotated	O
with	O
a	O
reference	O
to	O
this	O
.	O
</s>
<s>
EJBs	B-Language
are	O
deployed	B-Application
in	O
an	O
EJB	B-Language
container	I-Language
,	O
typically	O
within	O
an	O
application	B-Application
server	I-Application
.	O
</s>
<s>
The	O
specification	O
describes	O
how	O
an	O
EJB	B-Language
interacts	O
with	O
its	O
container	O
and	O
how	O
client	O
code	O
interacts	O
with	O
the	O
container/EJB	O
combination	O
.	O
</s>
<s>
The	O
EJB	B-Language
classes	O
used	O
by	O
applications	O
are	O
included	O
in	O
the	O
package	O
.	O
</s>
<s>
(	O
The	O
package	O
is	O
a	O
service	B-Application
provider	I-Application
interface	I-Application
used	O
only	O
by	O
EJB	B-Language
container	I-Language
implementations	O
.	O
)	O
</s>
<s>
Clients	O
of	O
EJBs	B-Language
do	O
not	O
instantiate	O
those	O
beans	O
directly	O
via	O
Java	B-Language
's	O
new	O
operator	O
,	O
but	O
instead	O
have	O
to	O
obtain	O
a	O
reference	O
via	O
the	O
EJB	B-Language
container	I-Language
.	O
</s>
<s>
A	O
client	O
is	O
said	O
to	O
have	O
a	O
'	O
view	O
 '	O
on	O
the	O
EJB	B-Language
,	O
and	O
the	O
local	O
interface	O
,	O
remote	O
interface	O
and	O
bean	O
type	O
itself	O
respectively	O
correspond	O
with	O
the	O
local	O
view	O
,	O
remote	O
view	O
and	O
no-interface	O
view	O
.	O
</s>
<s>
This	O
proxy	O
is	O
needed	O
in	O
order	O
to	O
give	O
the	O
EJB	B-Language
container	I-Language
the	O
opportunity	O
to	O
transparently	O
provide	O
cross-cutting	O
(	O
AOP-like	O
)	O
services	O
to	O
a	O
bean	O
like	O
transactions	O
,	O
security	O
,	O
interceptions	O
,	O
injections	O
,	O
and	O
remoting	B-Operating_System
.	O
</s>
<s>
As	O
an	O
example	O
,	O
a	O
client	O
invokes	O
a	O
method	B-Language
on	O
a	O
proxy	O
,	O
which	O
will	O
first	O
start	O
a	O
transaction	O
with	O
the	O
help	O
of	O
the	O
EJB	B-Language
container	I-Language
and	O
then	O
call	O
the	O
actual	O
bean	O
method	B-Language
.	O
</s>
<s>
When	O
the	O
bean	O
method	B-Language
returns	O
,	O
the	O
proxy	O
ends	O
the	O
transaction	O
(	O
i.e.	O
</s>
<s>
The	O
EJB	B-Language
Container	I-Language
is	O
responsible	O
for	O
ensuring	O
the	O
client	O
code	O
has	O
sufficient	O
access	O
rights	O
to	O
an	O
EJB	B-Language
.	O
</s>
<s>
Security	O
aspects	O
can	O
be	O
declaratively	O
applied	O
to	O
an	O
EJB	B-Language
via	O
annotations	B-Language
.	O
</s>
<s>
EJB	B-Language
containers	I-Language
must	O
support	O
both	O
container	O
managed	O
ACID	O
transactions	O
and	O
bean	O
managed	O
transactions	O
.	O
</s>
<s>
Container-managed	O
transactions	O
(	O
CMT	O
)	O
are	O
by	O
default	O
active	O
for	O
calls	O
to	O
session	B-Language
beans	I-Language
.	O
</s>
<s>
This	O
behavior	O
may	O
be	O
declaratively	O
tuned	O
by	O
the	O
bean	O
via	O
annotations	B-Language
and	O
if	O
needed	O
such	O
configuration	O
can	O
later	O
be	O
overridden	O
in	O
the	O
deployment	B-Language
descriptor	I-Language
.	O
</s>
<s>
Alternatively	O
,	O
the	O
bean	O
can	O
also	O
declare	O
via	O
an	O
annotation	O
that	O
it	O
wants	O
to	O
handle	O
transactions	O
programmatically	O
via	O
the	O
JTA	B-Language
API	O
.	O
</s>
<s>
JMS	B-Language
(	O
Java	B-Language
Message	I-Language
Service	I-Language
)	O
is	O
used	O
to	O
send	O
messages	O
from	O
beans	O
to	O
clients	O
,	O
to	O
let	O
clients	O
receive	O
asynchronous	O
messages	O
from	O
these	O
beans	O
.	O
</s>
<s>
As	O
an	O
alternative	O
to	O
injection	O
,	O
clients	O
of	O
an	O
EJB	B-Language
can	O
obtain	O
a	O
reference	O
to	O
the	O
session	B-Language
bean	I-Language
's	O
proxy	O
object	O
(	O
the	O
EJB	B-Language
stub	O
)	O
using	O
Java	B-Language
Naming	I-Language
and	I-Language
Directory	I-Language
Interface	I-Language
(	O
JNDI	B-Language
)	O
.	O
</s>
<s>
This	O
alternative	O
can	O
be	O
used	O
in	O
cases	O
where	O
injection	O
is	O
not	O
available	O
,	O
such	O
as	O
in	O
non-managed	O
code	O
or	O
standalone	O
remote	O
Java	B-Language
SE	O
clients	O
,	O
or	O
when	O
it	O
's	O
necessary	O
to	O
programmatically	O
determine	O
which	O
bean	O
to	O
obtain	O
.	O
</s>
<s>
JNDI	B-Language
names	O
for	O
EJB	B-Language
session	B-Language
beans	I-Language
are	O
assigned	O
by	O
the	O
EJB	B-Language
container	I-Language
via	O
the	O
following	O
scheme	O
:	O
</s>
<s>
For	O
communication	O
with	O
a	O
client	O
that	O
's	O
written	O
in	O
the	O
Java	B-Language
programming	I-Language
language	I-Language
a	O
session	B-Language
bean	I-Language
can	O
expose	O
a	O
remote-view	O
via	O
an	O
@Remote	O
annotated	O
interface	O
.	O
</s>
<s>
This	O
allows	O
those	O
beans	O
to	O
be	O
called	O
from	O
clients	O
in	O
other	O
JVMs	B-Language
which	O
themselves	O
may	O
be	O
located	O
on	O
other	O
(	O
remote	O
)	O
systems	O
.	O
</s>
<s>
From	O
the	O
point	O
of	O
view	O
of	O
the	O
EJB	B-Language
container	I-Language
,	O
any	O
code	O
in	O
another	O
JVM	B-Language
is	O
remote	O
.	O
</s>
<s>
Stateless	O
-	O
and	O
Singleton	O
session	B-Language
beans	I-Language
may	O
also	O
expose	O
a	O
"	O
web	O
service	O
client	O
view	O
"	O
for	O
remote	O
communication	O
via	O
WSDL	O
and	O
SOAP	B-Application
or	O
plain	O
XML	B-Protocol
.	O
</s>
<s>
This	O
follows	O
the	O
JAX-RPC	B-Language
and	O
JAX-WS	B-Language
specifications	O
.	O
</s>
<s>
JAX-RPC	B-Language
support	O
however	O
is	O
proposed	O
for	O
future	O
removal	O
.	O
</s>
<s>
To	O
support	O
JAX-WS	B-Language
,	O
the	O
session	B-Language
bean	I-Language
is	O
annotated	O
with	O
the	O
@WebService	O
annotation	O
,	O
and	O
methods	O
that	O
are	O
to	O
be	O
exposed	O
remotely	O
with	O
the	O
@WebMethod	O
annotation	O
..	O
</s>
<s>
Although	O
the	O
EJB	B-Language
specification	O
does	O
not	O
mention	O
exposure	O
as	O
RESTful	O
web	O
services	O
in	O
any	O
way	O
and	O
has	O
no	O
explicit	O
support	O
for	O
this	O
form	O
of	O
communication	O
,	O
the	O
JAX-RS	B-Language
specification	O
does	O
explicitly	O
support	O
EJB	B-Language
.	O
</s>
<s>
Following	O
the	O
JAX-RS	B-Language
spec	O
,	O
Stateless	O
-	O
and	O
Singleton	O
session	B-Language
beans	I-Language
can	O
be	O
root	O
resources	O
via	O
the	O
@Path	O
annotation	O
and	O
EJB	B-Language
business	O
methods	O
can	O
be	O
mapped	O
to	O
resource	O
methods	O
via	O
the	O
@GET	O
,	O
@PUT	O
,	O
@POST	O
and	O
@DELETE	O
annotations	B-Language
.	O
</s>
<s>
This	O
however	O
does	O
not	O
count	O
as	O
a	O
"	O
web	O
service	O
client	O
view	O
"	O
,	O
which	O
is	O
used	O
exclusively	O
for	O
JAX-WS	B-Language
and	O
JAX-RPC	B-Language
.	O
</s>
<s>
Communication	O
via	O
web	O
services	O
is	O
typical	O
for	O
clients	O
not	O
written	O
in	O
the	O
Java	B-Language
programming	I-Language
language	I-Language
,	O
but	O
is	O
also	O
convenient	O
for	O
Java	B-Language
clients	O
who	O
have	O
trouble	O
reaching	O
the	O
EJB	B-Language
server	O
via	O
a	O
firewall	O
.	O
</s>
<s>
Additionally	O
,	O
web	O
service	O
based	O
communication	O
can	O
be	O
used	O
by	O
Java	B-Language
clients	O
to	O
circumvent	O
the	O
arcane	O
and	O
ill-defined	O
requirements	O
for	O
the	O
so-called	O
"	O
client-libraries	O
"	O
;	O
a	O
set	O
of	O
jar	O
files	O
that	O
a	O
Java	B-Language
client	O
must	O
have	O
on	O
its	O
class-path	O
in	O
order	O
to	O
communicate	O
with	O
the	O
remote	O
EJB	B-Language
server	O
.	O
</s>
<s>
These	O
client-libraries	O
potentially	O
conflict	O
with	O
libraries	O
the	O
client	O
may	O
already	O
have	O
(	O
for	O
instance	O
,	O
if	O
the	O
client	O
itself	O
is	O
also	O
a	O
full	O
Java	B-Language
EE	I-Language
server	O
)	O
and	O
such	O
a	O
conflict	O
is	O
deemed	O
to	O
be	O
very	O
hard	O
or	O
impossible	O
to	O
resolve	O
.	O
</s>
<s>
With	O
EJB	B-Language
2.1	O
and	O
earlier	O
,	O
each	O
EJB	B-Language
had	O
to	O
provide	O
a	O
Java	B-Language
implementation	O
class	O
and	O
two	O
Java	B-Language
interfaces	O
.	O
</s>
<s>
The	O
EJB	B-Language
container	I-Language
created	O
instances	O
of	O
the	O
Java	B-Language
implementation	O
class	O
to	O
provide	O
the	O
EJB	B-Language
implementation	O
.	O
</s>
<s>
The	O
Java	B-Language
interfaces	O
were	O
used	O
by	O
client	O
code	O
of	O
the	O
EJB	B-Language
.	O
</s>
<s>
With	O
EJB	B-Language
2.1	O
and	O
earlier	O
,	O
the	O
EJB	B-Language
specification	O
required	O
a	O
deployment	B-Language
descriptor	I-Language
to	O
be	O
present	O
.	O
</s>
<s>
This	O
was	O
needed	O
to	O
implement	O
a	O
mechanism	O
that	O
allowed	O
EJBs	B-Language
to	O
be	O
deployed	B-Application
in	O
a	O
consistent	O
manner	O
regardless	O
of	O
the	O
specific	O
EJB	B-Language
platform	O
that	O
was	O
chosen	O
.	O
</s>
<s>
Information	O
about	O
how	O
the	O
bean	O
should	O
be	O
deployed	B-Application
(	O
such	O
as	O
the	O
name	O
of	O
the	O
home	O
or	O
remote	O
interfaces	O
,	O
whether	O
and	O
how	O
to	O
store	O
the	O
bean	O
in	O
a	O
database	O
,	O
etc	O
.	O
)	O
</s>
<s>
had	O
to	O
be	O
specified	O
in	O
the	O
deployment	B-Language
descriptor	I-Language
.	O
</s>
<s>
The	O
deployment	B-Language
descriptor	I-Language
is	O
an	O
XML	B-Protocol
document	I-Protocol
having	O
an	O
entry	O
for	O
each	O
EJB	B-Language
to	O
be	O
deployed	B-Application
.	O
</s>
<s>
This	O
XML	B-Protocol
document	I-Protocol
specifies	O
the	O
following	O
information	O
for	O
each	O
EJB	B-Language
:	O
</s>
<s>
Old	O
EJB	B-Language
containers	I-Language
from	O
many	O
vendors	O
required	O
more	O
deployment	B-Application
information	O
than	O
that	O
in	O
the	O
EJB	B-Language
specification	O
.	O
</s>
<s>
They	O
would	O
require	O
the	O
additional	O
information	O
as	O
separate	O
XML	B-Protocol
files	O
,	O
or	O
some	O
other	O
configuration	O
file	O
format	O
.	O
</s>
<s>
An	O
EJB	B-Language
platform	O
vendor	O
generally	O
provided	O
their	O
own	O
tools	O
that	O
would	O
read	O
this	O
deployment	B-Language
descriptor	I-Language
,	O
and	O
possibly	O
generated	O
a	O
set	O
of	O
classes	O
that	O
would	O
implement	O
the	O
now	O
deprecated	O
Home	O
and	O
Remote	O
interfaces	O
.	O
</s>
<s>
Since	O
EJB	B-Language
3.0	O
(	O
)	O
,	O
the	O
XML	B-Protocol
descriptor	O
is	O
replaced	O
by	O
Java	B-Language
annotations	I-Language
set	O
in	O
the	O
Enterprise	B-Language
Bean	I-Language
implementation	O
(	O
at	O
source	O
level	O
)	O
,	O
although	O
it	O
is	O
still	O
possible	O
to	O
use	O
an	O
XML	B-Protocol
descriptor	O
instead	O
of	O
(	O
or	O
in	O
addition	O
to	O
)	O
the	O
annotations	B-Language
.	O
</s>
<s>
If	O
an	O
XML	B-Protocol
descriptor	O
and	O
annotations	B-Language
are	O
both	O
applied	O
to	O
the	O
same	O
attribute	O
within	O
an	O
Enterprise	B-Language
Bean	I-Language
,	O
the	O
XML	B-Protocol
definition	O
overrides	O
the	O
corresponding	O
source-level	O
annotation	O
,	O
although	O
some	O
XML	B-Protocol
elements	O
can	O
also	O
be	O
additive	O
(	O
e.g.	O
,	O
an	O
activation-config-property	O
in	O
XML	B-Protocol
with	O
a	O
different	O
name	O
than	O
already	O
defined	O
via	O
an	O
@ActivationConfigProperty	O
annotation	O
will	O
be	O
added	O
instead	O
of	O
replacing	O
all	O
existing	O
properties	O
)	O
.	O
</s>
<s>
Starting	O
with	O
EJB	B-Language
3.1	O
,	O
the	O
EJB	B-Language
specification	O
defines	O
two	O
variants	O
of	O
the	O
EJB	B-Language
container	I-Language
;	O
a	O
full	O
version	O
and	O
a	O
limited	O
version	O
.	O
</s>
<s>
The	O
limited	O
version	O
adheres	O
to	O
a	O
proper	O
subset	O
of	O
the	O
specification	O
called	O
EJB	B-Language
3.1	O
Lite	O
and	O
is	O
part	O
of	O
Java	B-Language
EE	I-Language
6	I-Language
's	O
web	O
profile	O
(	O
which	O
is	O
itself	O
a	O
subset	O
of	O
the	O
full	O
Java	B-Language
EE	I-Language
6	I-Language
specification	O
)	O
.	O
</s>
<s>
EJB	B-Language
3.1	O
Lite	O
excludes	O
support	O
for	O
the	O
following	O
features	O
:	O
</s>
<s>
EJB	B-Language
3.2	O
Lite	O
excludes	O
less	O
features	O
.	O
</s>
<s>
Particularly	O
it	O
no	O
longer	O
excludes	O
@Asynchronous	O
and	O
@Schedule	O
/	O
@Timeout	O
,	O
but	O
for	O
@Schedule	O
it	O
does	O
not	O
support	O
the	O
"	O
persistent	O
"	O
attribute	O
that	O
full	O
EJB	B-Language
3.2	O
does	O
support	O
.	O
</s>
<s>
The	O
complete	O
excluded	O
list	O
for	O
EJB	B-Language
3.2	O
Lite	O
is	O
:	O
</s>
<s>
,	O
as	O
a	O
part	O
of	O
Jakarta	B-Language
EE	I-Language
9	I-Language
,	O
was	O
a	O
tooling	O
release	O
that	O
mainly	O
moved	O
API	O
package	O
names	O
from	O
the	O
top	O
level	O
package	O
to	O
the	O
top	O
level	O
package	O
.	O
</s>
<s>
Other	O
changes	O
included	O
removal	O
of	O
deprecated	O
APIs	O
that	O
were	O
pointless	O
to	O
move	O
to	O
the	O
new	O
top	O
level	O
package	O
and	O
the	O
removal	O
of	O
features	O
that	O
depended	O
on	O
features	O
that	O
were	O
removed	O
from	O
Java	B-Language
or	O
elsewhere	O
in	O
Jakarta	B-Language
EE	I-Language
9	I-Language
.	O
</s>
<s>
methods	O
relying	O
on	O
which	O
has	O
been	O
removed	O
from	O
the	O
Java	B-Language
14	O
.	O
</s>
<s>
methods	O
relying	O
on	O
Jakarta	B-Language
XML	I-Language
RPC	I-Language
to	O
reflect	O
the	O
removal	O
of	O
XML	B-Protocol
RPC	O
from	O
the	O
Jakarta	B-Language
EE	I-Language
9	I-Language
Platform	O
.	O
</s>
<s>
deprecated	O
method	B-Language
.	O
</s>
<s>
"	O
Support	O
for	O
Distributed	O
Interoperability	O
"	O
to	O
reflect	O
the	O
removal	O
of	O
CORBA	B-Architecture
from	O
Java	B-Language
11	O
and	O
the	O
Jakarta	B-Language
EE	I-Language
9	I-Language
Platform	O
.	O
</s>
<s>
Other	O
minor	O
changes	O
include	O
marking	O
the	O
Enterprise	B-Language
Beans	I-Language
2.x	O
API	O
Group	O
as	O
"	O
Optional	O
"	O
and	O
making	O
the	O
annotation	O
repeatable	O
.	O
</s>
<s>
,	O
as	O
a	O
part	O
of	O
Jakarta	B-Language
EE	I-Language
8	I-Language
,	O
and	O
despite	O
still	O
using	O
"	O
EJB	B-Language
"	O
abbreviation	O
,	O
this	O
set	O
of	O
APIs	O
has	O
been	O
officially	O
renamed	O
to	O
"	O
Jakarta	B-Language
Enterprise	I-Language
Beans	I-Language
"	O
by	O
the	B-Application
Eclipse	I-Application
Foundation	I-Application
so	O
as	O
not	O
to	O
tread	O
on	O
the	O
Oracle	O
"	O
Java	B-Language
"	O
trademark	O
.	O
</s>
<s>
Enterprise	B-Language
JavaBeans	I-Language
3.2	O
was	O
a	O
relatively	O
minor	O
release	O
that	O
mainly	O
contained	O
specification	O
clarifications	O
and	O
lifted	O
some	O
restrictions	O
that	O
were	O
imposed	O
by	O
the	O
spec	O
but	O
over	O
time	O
appeared	O
to	O
serve	O
no	O
real	O
purpose	O
.	O
</s>
<s>
A	O
few	O
existing	O
full	O
EJB	B-Language
features	O
were	O
also	O
demanded	O
to	O
be	O
in	O
EJB	B-Language
3	O
lite	O
and	O
functionality	O
that	O
was	O
proposed	O
to	O
be	O
pruned	O
in	O
EJB	B-Language
3.1	O
was	O
indeed	O
pruned	O
(	O
made	O
optional	O
)	O
.	O
</s>
<s>
The	O
purpose	O
of	O
the	O
Enterprise	B-Language
JavaBeans	I-Language
3.1	O
specification	O
is	O
to	O
further	O
simplify	O
the	O
EJB	B-Language
architecture	O
by	O
reducing	O
its	O
complexity	O
from	O
the	O
developer	O
's	O
point	O
of	O
view	O
,	O
while	O
also	O
adding	O
new	O
functionality	O
in	O
response	O
to	O
the	O
needs	O
of	O
the	O
community	O
:	O
</s>
<s>
This	O
release	O
made	O
it	O
much	O
easier	O
to	O
write	O
EJBs	B-Language
,	O
using	O
'	O
annotations	B-Language
 '	O
rather	O
than	O
the	O
complex	O
'	O
deployment	B-Language
descriptors	I-Language
 '	O
used	O
in	O
version	O
2.x	O
.	O
</s>
<s>
The	O
use	O
of	O
home	O
and	O
remote	O
interfaces	O
and	O
the	O
ejb-jar.xml	O
file	O
were	O
also	O
no	O
longer	O
required	O
in	O
this	O
release	O
,	O
having	O
been	O
replaced	O
with	O
a	O
business	O
interface	O
and	O
a	O
bean	O
that	O
implements	O
the	O
interface	O
.	O
</s>
<s>
Web	O
service	O
support	O
(	O
new	O
)	O
:	O
stateless	B-Language
session	I-Language
beans	I-Language
can	O
be	O
invoked	O
over	O
SOAP/HTTP	O
.	O
</s>
<s>
Also	O
,	O
an	O
EJB	B-Language
can	O
easily	O
access	O
a	O
Web	O
service	O
using	O
the	O
new	O
service	O
reference	O
.	O
</s>
<s>
EJB	B-Language
timer	O
service	O
(	O
new	O
)	O
:	O
Event-based	O
mechanism	O
for	O
invoking	O
EJBs	B-Language
at	O
specific	O
times	O
.	O
</s>
<s>
Message-driven	B-Language
beans	I-Language
accepts	O
messages	O
from	O
sources	O
other	O
than	O
JMS	B-Language
.	O
</s>
<s>
Message	O
destinations	O
(	O
the	O
same	O
idea	O
as	O
EJB	B-Language
references	O
,	O
resource	O
references	O
,	O
etc	O
.	O
)	O
</s>
<s>
EJB	B-Language
query	O
language	O
(	O
EJB-QL	O
)	O
additions	O
:	O
ORDER	O
BY	O
,	O
AVG	O
,	O
MIN	O
,	O
MAX	O
,	O
SUM	O
,	O
COUNT	O
,	O
and	O
MOD	O
.	O
</s>
<s>
The	O
standard	O
component	O
architecture	O
for	O
building	O
distributed	O
object-oriented	O
business	O
applications	O
in	O
Java	B-Language
.	O
</s>
<s>
Make	O
it	O
possible	O
to	O
build	O
distributed	B-Architecture
applications	I-Architecture
by	O
combining	O
components	O
developed	O
using	O
tools	O
from	O
different	O
vendors	O
.	O
</s>
<s>
Make	O
it	O
easy	O
to	O
write	O
(	O
enterprise	O
)	O
applications	O
:	O
Application	O
developers	O
will	O
not	O
have	O
to	O
understand	O
low-level	O
transaction	O
and	O
state	B-Application
management	O
details	O
,	O
multi-threading	O
,	O
connection	O
pooling	O
,	O
and	O
other	O
complex	O
low-level	O
APIs	O
.	O
</s>
<s>
Will	O
follow	O
the	O
"	O
Write	O
Once	O
,	O
Run	O
Anywhere	O
"	O
philosophy	O
of	O
Java	B-Language
.	O
</s>
<s>
An	O
enterprise	B-Language
Bean	I-Language
can	O
be	O
developed	O
once	O
,	O
and	O
then	O
deployed	B-Application
on	O
multiple	O
platforms	O
without	O
recompilation	O
or	O
source	O
code	O
modification	O
.	O
</s>
<s>
Address	O
the	O
development	O
,	O
deployment	B-Application
,	O
and	O
runtime	O
aspects	O
of	O
an	O
enterprise	B-Application
application	I-Application
’s	O
life	O
cycle	O
.	O
</s>
<s>
Vendors	O
will	O
be	O
able	O
to	O
extend	O
their	O
existing	O
products	O
to	O
support	O
EJBs	B-Language
.	O
</s>
<s>
Be	O
compatible	O
with	O
other	O
Java	B-Language
APIs	I-Language
.	O
</s>
<s>
Provide	O
interoperability	O
between	O
enterprise	B-Language
Beans	I-Language
and	O
Java	B-Language
EE	I-Language
components	O
as	O
well	O
as	O
non-Java	O
programming	O
language	O
applications	O
.	O
</s>
<s>
Be	O
compatible	O
with	O
the	O
CORBA	B-Architecture
protocols	O
(	O
RMI-IIOP	B-Language
)	O
.	O
</s>
<s>
Provide	O
better	O
support	O
for	O
application	O
assembly	O
and	O
deployment	B-Application
.	O
</s>
<s>
Specify	O
in	O
greater	O
detail	O
the	O
responsibilities	O
of	O
the	O
individual	O
EJB	B-Language
roles	O
.	O
</s>
<s>
Defined	O
the	O
distinct	O
"	O
EJB	B-Language
Roles	O
"	O
that	O
are	O
assumed	O
by	O
the	O
component	O
architecture	O
.	O
</s>
<s>
Defined	O
the	O
client	O
view	O
of	O
enterprise	B-Language
Beans	I-Language
.	O
</s>
<s>
Defined	O
the	O
enterprise	B-Language
Bean	I-Language
developer	O
’s	O
view	O
.	O
</s>
<s>
Defined	O
the	O
responsibilities	O
of	O
an	O
EJB	B-Language
Container	I-Language
provider	O
and	O
server	O
provider	O
;	O
together	O
these	O
make	O
up	O
a	O
system	O
that	O
supports	O
the	O
deployment	B-Application
and	O
execution	O
of	O
enterprise	B-Language
Beans	I-Language
.	O
</s>
