David Blevins / Apache Software FoundationFun with EJB 3.1 //And OpenEJB
OpenEJB historyTimeline   • 1999 - Founded in Exoffice - EJB 1.1 level   • 2001 - Integrated in Apple’s WebObjects   • 200...
Specification InvolvementVersions   • EJB 2.1 (Monson-Haefel)   • EJB 3.0 (Blevins)   • EJB 3.1 (Blevins)   • EJB 3.2* (Bl...
OpenEJB historyAlways an Embedded EJB Container   • Our downfall in early 2000 -- people weren’t ready   • Our success aft...
Primer
Generic view of ContainersComponents    • What “classes” of objects are there?Lifecycle    • What “events” do objects want...
EJB through 3.0
EJB through 3.0Components  • @Stateless (1.0, 3.0)  • @Stateful (1.0, 3.0)  • @MessageDriven (2.0, 3.0)Views   • @Local (3...
EJB through 3.0Lifecycle    • Dependency Injection (3.0)    • @PostConstruct (1.1, 3.0)    • @PreDestroy (1.1, 3.0)    • S...
EJB through 3.0Services   • @TransactionManagement (1.1, 3.0)      • @TransactionAttribute (1.1, 3.0)   • Security (1.1, 3...
EJB through 3.0Environment   • @Resource (1.1, 2.0, 2.1, 3.0)      • UserTransaction      • DataSource      • JMS Connecti...
EJB through 3.0Packaging   • Java EE Server      • Standalone EJB jar file         • No standard mechanism for 3rd party l...
EJB 3.1
EJB 3.1Components  • @SingletonViews   • @LocalBean   • @AsynchronousEnvironment   • Global JNDI Names                    ...
EJB 3.1Lifecycle    • Singletons       • @Startup           • @DependsOn    • Stateful       • @StatefulTimeout       • @A...
EJB 3.1Services   • @ConcurrencyManagement      • @Lock      • @AccessTimeout   • @Interceptors      • @AroundTimeout   • ...
EJB 3.1Packaging   • Java EE      • EJB jars in WAR files   • Java SE VM      • Embedded EJBContainer API         • Jar sc...
Next Gen EJB
Next Gen EJBComponents  • @ManagedBean (plain cheese pizza, no toppings)Services   • Split them out individually (the topp...
Next Gen EJBInterceptors    • Multiple, qualified, @AroundInvoke methods    • Middle ground between Loose & Strong typing ...
Next Gen EJBMessage Driven 2.0  • Allow Connector annotations to be used     • Eliminate loosely typed activation-config  ...
Apache TomEE: Tomcat with a Kick   2:25 - 3:15 | Beatrice Suite 1            WednesdayDavid Blevins & Jonathan Gallimore
Thank You!openejb.apache.org   David Blevinsdblevins@apache.org twitter.com/dblevins
Upcoming SlideShare
Loading in...5
×

Fun with EJB 3.1 and Open EJB

4,471

Published on

Fun with EJB 3.1 and Open EJB @ JAX London

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,471
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
135
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Fun with EJB 3.1 and Open EJB

    1. 1. David Blevins / Apache Software FoundationFun with EJB 3.1 //And OpenEJB
    2. 2. OpenEJB historyTimeline • 1999 - Founded in Exoffice - EJB 1.1 level • 2001 - Integrated in Apple’s WebObjects • 2002 - Moved to SourceForge • 2003 - Integrated in Apache Geronimo • 2004 - Moved to Codehaus • 2006 - Moved to Apache Incubator • 2007 - Graduated Apache OpenEJB • 2011 - Integrated in Apache TomEE 2
    3. 3. Specification InvolvementVersions • EJB 2.1 (Monson-Haefel) • EJB 3.0 (Blevins) • EJB 3.1 (Blevins) • EJB 3.2* (Blevins) 3
    4. 4. OpenEJB historyAlways an Embedded EJB Container • Our downfall in early 2000 -- people weren’t ready • Our success after EJB 3.0Always doing the Opposite • EJB always had Inversion of Control • Instead of Remote/Local beans, why not Remote/Local containers? • Instead of putting the App in the Container, put the Container in the App. • WARs the bottom of the food chain? Forget that, put everything in the WAR. EARs are WARs anyway. • Don’t blame EJB because your *server* isn’t testable 4
    5. 5. Primer
    6. 6. Generic view of ContainersComponents • What “classes” of objects are there?Lifecycle • What “events” do objects want to know about?Views • How are they accessed internally or externally?Services • What “actions” will the container manage for you?Environment • What “resources” will be exposed to you?Packaging • How do you build & run this crazy thing? 6
    7. 7. EJB through 3.0
    8. 8. EJB through 3.0Components • @Stateless (1.0, 3.0) • @Stateful (1.0, 3.0) • @MessageDriven (2.0, 3.0)Views • @Local (3.0) • @Remote (3.0) • @WebService (2.1, 3.0) 8
    9. 9. EJB through 3.0Lifecycle • Dependency Injection (3.0) • @PostConstruct (1.1, 3.0) • @PreDestroy (1.1, 3.0) • Stateful specific • @PrePassivate (1.1, 3.0) • @PostActivate (1.1, 3.0) • SessionSynchronization (1.1) 9
    10. 10. EJB through 3.0Services • @TransactionManagement (1.1, 3.0) • @TransactionAttribute (1.1, 3.0) • Security (1.1, 3.0) • @PermitAll (1.1, 3.0) • @DenyAll (1.1, 3.0) • @RolesAllowed (1.1, 3.0) • @Interceptors (3.0) • TimerService (2.0) 10
    11. 11. EJB through 3.0Environment • @Resource (1.1, 2.0, 2.1, 3.0) • UserTransaction • DataSource • JMS ConnectionFactory/Topic/Queue • Much more.. • @EJB (1.1, 2.0, 3.0) • @PersistenceContext (3.0) • @PersistenceUnit (3.0) • @WebServiceRef (2.1, 3.0) 11
    12. 12. EJB through 3.0Packaging • Java EE Server • Standalone EJB jar file • No standard mechanism for 3rd party libs • Combined in an EAR file 12
    13. 13. EJB 3.1
    14. 14. EJB 3.1Components • @SingletonViews • @LocalBean • @AsynchronousEnvironment • Global JNDI Names 14
    15. 15. EJB 3.1Lifecycle • Singletons • @Startup • @DependsOn • Stateful • @StatefulTimeout • @AfterBegin • @BeforeCompletion • @AfterCompletion 15
    16. 16. EJB 3.1Services • @ConcurrencyManagement • @Lock • @AccessTimeout • @Interceptors • @AroundTimeout • @Schedule 16
    17. 17. EJB 3.1Packaging • Java EE • EJB jars in WAR files • Java SE VM • Embedded EJBContainer API • Jar scanning a plain classpath • Modules: File/File[]/String/String[] 17
    18. 18. Next Gen EJB
    19. 19. Next Gen EJBComponents • @ManagedBean (plain cheese pizza, no toppings)Services • Split them out individually (the toppings)Meta Annotations • Rename the annotations to your liking • Summarize complex config easily • Reduce impact of change 19
    20. 20. Next Gen EJBInterceptors • Multiple, qualified, @AroundInvoke methods • Middle ground between Loose & Strong typing • aka between Interceptor and Decorator • Fix Invoke signature mismatchApplicationException • Needs finer-grained control 20
    21. 21. Next Gen EJBMessage Driven 2.0 • Allow Connector annotations to be used • Eliminate loosely typed activation-config • Allow No-Interface MDBs • Connector Annotations are all that is needed • Psst, MDBs are really just Session beans • Why not allow @Singleton message consumers?Non-AppClient injection • Non-AppClient lookup, check. Where’s injection? • @LocalClient and @RemoteClient 21
    22. 22. Apache TomEE: Tomcat with a Kick 2:25 - 3:15 | Beatrice Suite 1 WednesdayDavid Blevins & Jonathan Gallimore
    23. 23. Thank You!openejb.apache.org David Blevinsdblevins@apache.org twitter.com/dblevins
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×