Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
10Activity
0 of .
Results for:
No results containing your search query
P. 1
Introduction EJB3

Introduction EJB3

Ratings: (0)|Views: 922|Likes:
Published by api-27341052

More info:

Published by: api-27341052 on Oct 15, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

1
Professional Open Source\u2122
\u00a9 JBoss, Inc. 2003-2005.
1
8/2/2005
Introduction to EJB3
Preview to New Enterprise JavaBean Technology
\u00a9 JBoss, Inc. 2003-2005.
2
Professional Open Source\u2122
Topics
\u2013 Goals of EJB3
\u2013 New Enterprise Bean Contract
\u2013 Interceptors
\u2013 Persistence API
2
\u00a9 JBoss, Inc. 2003-2005.
3
Professional Open Source\u2122
Goals of EJB3
Simplify the EJB component development
\u2013 Reduce the amount of \u201dboiler-plate\u201d code
\u2022 Remote, Local, Home interfaces
\u2013 Take advantage of the new Java annotation features
\u2022 Formalize code generation that was formerly done with tools
\u2013 Reduce the amount of deployment descriptors

\u2013 Overhaul of the persistence model
\u2022 Enable light-weight domain object models
\u2022 Support inheritance and polymorphism
\u2022 Address O/R Mapping configuration
\u2022 Enhance EJB-QL, dynamic queries, support for native SQL

\u2013 Simplify environmental dependencies with Dependency Injection
\u2013 Increase reusability of EJB components by moving closer to JavaBean or
Plain Old Java Object (POJO) modelsHow does this show up in practice?
How does this show up in practice?
\u00a9 JBoss, Inc. 2003-2005.
4
Professional Open Source\u2122
Overview of Simplified EJB3 API
\u2013 No home interfaces
\u2022 Removal of EJBHome and EJBLocalHome interfaces

\u2013 Session remote interface can be
\u2022 Defined by Plain Old Java Interface (POJI)
\u2022 Removal of EJBObject and EJBLocalObject interfaces

\u2013 No mandated interfaces for bean class
\u2022 Removal of SessionBean, EntityBean interfaces
\u2013 Backward compatibility
\u2022 EJBHome, EJBLocalHome, EJBObject, EJBLocalObject supported
for 2.x clients
\u2022 All metadata can be specified through deployment descriptors (ejb-
jar.xml and jboss.xml)
Let\u2019s see a comparison example.
Let\u2019s see a comparison example.
3
\u00a9 JBoss, Inc. 2003-2005.
5
Professional Open Source\u2122
Removal of Home Interfaces
Home interfaces not required
\u2013 Applies to both Session and Entity beans
\u2013 Message Driven Beans never had home interfaces in the first place
What about home.create() calls?
\u2013 For stateless session this was a no-op, no state to initialize
\u2013 For stateful session, the bean isuninit i ali ze d from client\u2019s point of view
\u2022 Use the business interface methods to initialize the session to a
proper state
What about home.remove() and home.find() calls?
\u2013 For stateless session this was no-op, container ignored it
\u2013 For stateful, any method signature can be annotated to mark the end of
the session\u2019s life cycle (more on this later)
\u2013 For entities, remove and find calls are managed via persistence context
(EntityManager and Query interfaces \u2013 more on these later)
\u00a9 JBoss, Inc. 2003-2005.
6
Professional Open Source\u2122
Stateless Session Bean Example: Home Interfaces
EJB 2.x:
import java.rmi.*;
import javax.ejb.*;
public interface AccountManagerHome extends EJBHome {
public AccountManager create() throws RemoteException, CreateException;
}
import java.rmi.*;
import javax.ejb.*;
public interface AccountManagerHome extends EJBHome {
publicAccou n tMan ag ercreate() throws RemoteException, CreateException;
}
EJB 3.x:
// NOT REQUIRED!!
// NOT REQUIRED!!

This call to home interface was
always redundant \u2013 the instance is
created by the container and
returned from the pool.

Activity (10)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
s.roy2 liked this
gnanaseelanae liked this
anuragmudgal liked this
bh4scribd liked this
ambird liked this
saurabh_amit liked this
Ranganath Yadav liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->