SlideShare a Scribd company logo
Modular EJBs in OSGi Tim Ward IBM 21 Sep 2011 OSGi Alliance Marketing © 2008-2010 . All Rights Reserved  Page
Legal Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.
OSGi and the OSGi logo are trademarks or registered trademarks of the OSGi Alliance
Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at  www.ibm.com/legal/copytrade.shtml Page
Agenda A Quick EJB refresher
How EJBs might fit into OSGi
A case study in implementing Modular EJB
Proof that it really works
Terminology EJB  –  Enterprise Java Bean
EJB JAR  –  A JAR packaging EJBs
Modular EJB  –  An EJB running in OSGi
EJB Bundle –  An OSGi bundle packaging  Modular EJBs
EJBs – the basics EJBs are managed objects, the container injects their dependencies Session EJBs define one or more business “views” These proxy the real EJB object(s)
The same view object may delegate to the same, or a different, EJB for successive calls
Different EJB types have different delegation styles The EJB runtime adds declarative transactions, security and other services when a business method is called
EJB Views and OSGi services EJB View OSGi Service Cardinality May proxy one or many EJB objects One per registration or one per client bundle Location Stored in JNDI Stored in the OSGi service registry Interface One business interface per EJB view One service may expose many interfaces Lifecycle Relatively static once created, no reinjection, no notifications from JNDI Dynamic, may be removed or modified and underlying dependencies may change An EJB view shares a number of concepts with an OSGi service. Page
Integrating EJBs with OSGi The service registry is  the  integration point in OSGi Expose modular EJBs as OSGi services Register one service per EJB view Remote EJB views should be Remoteable Services service.exported.interfaces = * EJB services only work with the right lookup lifecycle Stateless are an interchangable pool
Singleton is like a normal service
Stateful EJBs are “one per lookup”
Identifying EJB Bundles in OSGi  Requirement EJB Bundles should be able to be valid EJB JARs
Fit with existing OSGi module types (e.g. WABs) Proposal Add a new header “Export-EJB:” Identifies a bundle as an EJB-Bundle
Defines which EJBs are exposed as OSGi services
Pioneered by Glassfish Application Server Known to work –  good basis for a standard?
Running Modular EJBs in Aries  Apache Aries provides pieces of an OSGi container Integrate with existing projects where possible OpenEJB has been packaged as an OSGi bundle for a couple of releases Some tentative OSGi support, little true integration Mission Statement Integrate OpenEJB with existing OSGi standards and Aries features to provide support for Modular EJBs
Issues Running EJBs in OSGi  Locating EJBs in OSGi bundles
OSGi class loading semantics
Building EJB proxy stubs
Transaction Manager integration
JPA integration
Security integration
Miscellaneous
Working with EJB Bundles  – Finding the EJBs EJBs are defined in one of two ways via annotations  @Stateless
via XML  <session>... Requirement 1 says that EJB Bundles should put  XML in  META-INF/ejb-jar.xml  (just like Java EE)
Finding the XML is non-trivial for OpenEJB in OSGi Use the extender pattern to help OpenEJB out
Recognise bundles using Export-EJB header
Working with EJB Bundles  – Finding the EJBs (2) Finding Annotated EJBs much harder than for XML Typically a OpenEJB “scans” the classpath by listing files on the file system (using  file:  or  jar:  URLs) In OSGi there is no guarantee of the bundle being on the filesystem (or in its original layout) Typical scanning breaks at this point, so either: Try to scan the raw bundle bytes (if they exist!) No fragments, imports or bundle classpath Implement an OSGi aware scanner

More Related Content

PDF
Architecture | Modular Enterprise Applications | Mark Nuttall
PDF
Jax london 2011
PDF
Create *real* modular Java applications - a brief introduction -
PPTX
Introduction to OSGi
PDF
Concierge - Bringing OSGi (back) to Embedded Devices
PDF
OpenJDK Penrose Presentation (JavaOne 2012)
PPSX
Introduction to Java
PDF
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
Architecture | Modular Enterprise Applications | Mark Nuttall
Jax london 2011
Create *real* modular Java applications - a brief introduction -
Introduction to OSGi
Concierge - Bringing OSGi (back) to Embedded Devices
OpenJDK Penrose Presentation (JavaOne 2012)
Introduction to Java
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011

What's hot (18)

PDF
Introducing Java 7
PDF
The State of Java under Oracle at JCertif 2011
PDF
Core java interview questions
PDF
9 crucial Java Design Principles you cannot miss
PDF
Running your Java EE applications in the Cloud
PDF
Java interview questions
PDF
Java and Java platforms
PDF
50+ java interview questions
PPT
Java interview-questions-and-answers
PPT
.NET Vs J2EE
PPT
Java & J2EE Struts with Hibernate Framework
PDF
JDT Fundamentals 2010
PDF
Top 100 Java Interview Questions with Detailed Answers
DOCX
Hibernate3 q&a
PDF
Building Content Applications with JCR and OSGi
PPTX
Java introduction
PDF
J2EE vs JavaEE
PDF
What is-java
Introducing Java 7
The State of Java under Oracle at JCertif 2011
Core java interview questions
9 crucial Java Design Principles you cannot miss
Running your Java EE applications in the Cloud
Java interview questions
Java and Java platforms
50+ java interview questions
Java interview-questions-and-answers
.NET Vs J2EE
Java & J2EE Struts with Hibernate Framework
JDT Fundamentals 2010
Top 100 Java Interview Questions with Detailed Answers
Hibernate3 q&a
Building Content Applications with JCR and OSGi
Java introduction
J2EE vs JavaEE
What is-java
Ad

Viewers also liked (20)

PDF
Pitfalls of migrating projects to JDK 9
PPT
Android | Busy Java Developers Guide to Android: UI | Ted Neward
PDF
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
PDF
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
ODP
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
PDF
Modules all the way down: OSGi and the Java Platform Module System
PDF
Java modularity: life after Java 9
PDF
Art4705 historyof photography
PDF
Arh2050 sp2015 syllabus
PDF
Mobilys - Mobile Apps Development
DOCX
Artikel Wirausaha
PPTX
Historically Important People
PDF
Comrades
PPTX
Presentation1
PDF
Tsahim 3
PDF
2003 Spring Newsletter
PDF
Arh2050 fa2014 proust questionnaire
PPTX
Tabasco
PDF
希望新聞特別版のご紹介
DOCX
सुनामी
Pitfalls of migrating projects to JDK 9
Android | Busy Java Developers Guide to Android: UI | Ted Neward
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
Modules all the way down: OSGi and the Java Platform Module System
Java modularity: life after Java 9
Art4705 historyof photography
Arh2050 sp2015 syllabus
Mobilys - Mobile Apps Development
Artikel Wirausaha
Historically Important People
Comrades
Presentation1
Tsahim 3
2003 Spring Newsletter
Arh2050 fa2014 proust questionnaire
Tabasco
希望新聞特別版のご紹介
सुनामी
Ad

Similar to Java EE | Modular EJBs for Enterprise OSGi | Tim Ward (20)

PDF
modular-ejbs-for-enterprise-osgi developers
PDF
Modular EJBs in OSGi - Tim Ward
PDF
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries
PDF
OSGi Community Event 2010 - A Crash Course in OSGi Application Development
PPT
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
PDF
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
PDF
Ejb intro
PPTX
EJB3 Basics
PPTX
Hybrid Applications
PDF
Monoliths are so 2001 – What you need is Modularity
PDF
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
PPT
Apache Aries: A blueprint for developing with OSGi and JEE
PDF
Karaf ee-apachecon eu-2012
PDF
OSGi tech session
PDF
Ejb intro
PDF
practical-guide-to-modularity with Java osgi
PDF
GlassFish OSGi - Java2days 2010
PPTX
Introduction to OSGi - Part-1
PPT
OSGi Persistence With EclipseLink
ODP
Apache Aries Blog Sample
modular-ejbs-for-enterprise-osgi developers
Modular EJBs in OSGi - Tim Ward
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries
OSGi Community Event 2010 - A Crash Course in OSGi Application Development
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
Ejb intro
EJB3 Basics
Hybrid Applications
Monoliths are so 2001 – What you need is Modularity
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
Apache Aries: A blueprint for developing with OSGi and JEE
Karaf ee-apachecon eu-2012
OSGi tech session
Ejb intro
practical-guide-to-modularity with Java osgi
GlassFish OSGi - Java2days 2010
Introduction to OSGi - Part-1
OSGi Persistence With EclipseLink
Apache Aries Blog Sample

More from JAX London (20)

PDF
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
PDF
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
PDF
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
PDF
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
PDF
Spring Day | Identity Management with Spring Security | Dave Syer
PDF
Spring Day | Spring and Scala | Eberhard Wolff
PDF
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
PPT
Keynote | The Rise and Fall and Rise of Java | James Governor
ODP
Java Tech & Tools | OSGi Best Practices | Emily Jiang
PPTX
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
PDF
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
PDF
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
PDF
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
PDF
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
PDF
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
PDF
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
KEY
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
PPTX
Java Core | JavaFX 2.0: Great User Interfaces in Java | Simon Ritter
PPT
Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
PDF
Java Core | Concurrency in the Java Language and Platform | Fredrik Ohrstrom
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Spring Day | WaveMaker - Spring Roo - SpringSource Tool Suite: Choosing the R...
Spring Day | Behind the Scenes at Spring Batch | Dave Syer
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Identity Management with Spring Security | Dave Syer
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
Keynote | The Rise and Fall and Rise of Java | James Governor
Java Tech & Tools | OSGi Best Practices | Emily Jiang
Java Tech & Tools | Beyond the Data Grid: Coherence, Normalisation, Joins and...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Social Media in Programming in Java | Khanderao Kand
Java Tech & Tools | Just Keep Passing the Message | Russel Winder
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
Java EE | Apache TomEE - Java EE Web Profile on Tomcat | Jonathan Gallimore
Java Core | Understanding the Disruptor: a Beginner's Guide to Hardcore Concu...
Java Core | JavaFX 2.0: Great User Interfaces in Java | Simon Ritter
Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Concurrency in the Java Language and Platform | Fredrik Ohrstrom

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPT
Teaching material agriculture food technology
PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Spectroscopy.pptx food analysis technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Machine learning based COVID-19 study performance prediction
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25 Week I
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Encapsulation theory and applications.pdf
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Teaching material agriculture food technology
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Spectroscopy.pptx food analysis technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
MYSQL Presentation for SQL database connectivity
Machine learning based COVID-19 study performance prediction
sap open course for s4hana steps from ECC to s4
Agricultural_Statistics_at_a_Glance_2022_0.pdf

Java EE | Modular EJBs for Enterprise OSGi | Tim Ward

  • 1. Modular EJBs in OSGi Tim Ward IBM 21 Sep 2011 OSGi Alliance Marketing © 2008-2010 . All Rights Reserved Page
  • 2. Legal Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.
  • 3. OSGi and the OSGi logo are trademarks or registered trademarks of the OSGi Alliance
  • 4. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at www.ibm.com/legal/copytrade.shtml Page
  • 5. Agenda A Quick EJB refresher
  • 6. How EJBs might fit into OSGi
  • 7. A case study in implementing Modular EJB
  • 8. Proof that it really works
  • 9. Terminology EJB – Enterprise Java Bean
  • 10. EJB JAR – A JAR packaging EJBs
  • 11. Modular EJB – An EJB running in OSGi
  • 12. EJB Bundle – An OSGi bundle packaging Modular EJBs
  • 13. EJBs – the basics EJBs are managed objects, the container injects their dependencies Session EJBs define one or more business “views” These proxy the real EJB object(s)
  • 14. The same view object may delegate to the same, or a different, EJB for successive calls
  • 15. Different EJB types have different delegation styles The EJB runtime adds declarative transactions, security and other services when a business method is called
  • 16. EJB Views and OSGi services EJB View OSGi Service Cardinality May proxy one or many EJB objects One per registration or one per client bundle Location Stored in JNDI Stored in the OSGi service registry Interface One business interface per EJB view One service may expose many interfaces Lifecycle Relatively static once created, no reinjection, no notifications from JNDI Dynamic, may be removed or modified and underlying dependencies may change An EJB view shares a number of concepts with an OSGi service. Page
  • 17. Integrating EJBs with OSGi The service registry is the integration point in OSGi Expose modular EJBs as OSGi services Register one service per EJB view Remote EJB views should be Remoteable Services service.exported.interfaces = * EJB services only work with the right lookup lifecycle Stateless are an interchangable pool
  • 18. Singleton is like a normal service
  • 19. Stateful EJBs are “one per lookup”
  • 20. Identifying EJB Bundles in OSGi Requirement EJB Bundles should be able to be valid EJB JARs
  • 21. Fit with existing OSGi module types (e.g. WABs) Proposal Add a new header “Export-EJB:” Identifies a bundle as an EJB-Bundle
  • 22. Defines which EJBs are exposed as OSGi services
  • 23. Pioneered by Glassfish Application Server Known to work – good basis for a standard?
  • 24. Running Modular EJBs in Aries Apache Aries provides pieces of an OSGi container Integrate with existing projects where possible OpenEJB has been packaged as an OSGi bundle for a couple of releases Some tentative OSGi support, little true integration Mission Statement Integrate OpenEJB with existing OSGi standards and Aries features to provide support for Modular EJBs
  • 25. Issues Running EJBs in OSGi Locating EJBs in OSGi bundles
  • 26. OSGi class loading semantics
  • 32. Working with EJB Bundles – Finding the EJBs EJBs are defined in one of two ways via annotations @Stateless
  • 33. via XML <session>... Requirement 1 says that EJB Bundles should put XML in META-INF/ejb-jar.xml (just like Java EE)
  • 34. Finding the XML is non-trivial for OpenEJB in OSGi Use the extender pattern to help OpenEJB out
  • 35. Recognise bundles using Export-EJB header
  • 36. Working with EJB Bundles – Finding the EJBs (2) Finding Annotated EJBs much harder than for XML Typically a OpenEJB “scans” the classpath by listing files on the file system (using file: or jar: URLs) In OSGi there is no guarantee of the bundle being on the filesystem (or in its original layout) Typical scanning breaks at this point, so either: Try to scan the raw bundle bytes (if they exist!) No fragments, imports or bundle classpath Implement an OSGi aware scanner
  • 37. Apache Aries – Locating META-INF/ejb-jar.xml OpenEJB allows us to build our own EJBModule representing the EJB Bundle
  • 38. An EJBModule allows us to supply a URL to the EJB XML deployment descriptor This is parsed and processed by OpenEJB Aries makes all .xml files in META-INF available Covers other Java EE specs
  • 40. Apache Aries – Writing an OSGi aware scanner In OSGi 4.3 a new core API method was added BundleWiring.listResources(String, String, int) We can use this to build an OSGi specific Xbean scanner for our EJBModule for (String resource : bundle.adapt(BundleWiring. class ). listResources( &quot;/&quot; , &quot;*.class&quot; , LISTRESOURCES_RECURSE )) { URL u = bundle.getResource(resource) readClassDef(u.openStream()); }
  • 41. Issues Running EJBs in OSGi Locating EJBs in OSGi bundles
  • 42. OSGi class loading semantics
  • 48. Java EE vs OSGi class loading One of the key differences between OSGi and Java EE is how they load classes
  • 49. Java EE has a hierarchy of ClassLoader instances EJB JAR -> Application -> EJB Container -> Java OSGi has a ClassLoader network...
  • 50. Apache Aries – Classloading for EJB Bundles Clearly the OpenEJB EJBModule ClassLoader should be the EJB Bundle ClassLoader
  • 51. OpenEJB relies on the fact that its internals are visible from the EJB JAR ClassLoader No requirement for EJB Bundles to import OpenEJB
  • 52. Make OpenEJB visible from Application ClassLoader EJB Bundle EJB API Business API
  • 53. Issues Running EJBs in OSGi Locating EJBs in OSGi bundles
  • 54. OSGi class loading semantics
  • 60. Implementing EJBs in OSGi EJBs are usually implemented using proxy “stubs” Implement a single business interface
  • 61. May implement other container specific interfaces
  • 62. Often implement javax.naming.Referencable Stubs may be dynamic proxys or generated classes In either case they must be loaded as classes In OSGi each bundle has a different ClassLoader There may not be any one bundle that can see all the interfaces on the proxy!
  • 63. Apache Aries – OSGi safe proxy classes Aries contains an OSGi aware proxy implementation Supports dynamic interface implementation generation for one to N interfaces The proxy allows a parent bundle to be specified The proxy understands that not all interfaces may be visible to the bundle! Aries replaces the default OpenEJB Proxy factory EJB stubs can use any mixture of interfaces
  • 64. Issues Running EJBs in OSGi Locating EJBs in OSGi bundles
  • 65. OSGi class loading semantics
  • 71. EJBs and Transactions EJBs have an extremely strong link with transactions All invocations use a global transaction by default More complex interactions can be configured EJBs can control their own transactions too In OSGi we use the JTA Service to get hold of a TransactionManager OpenEJB knows nothing about this... Tx Client
  • 72. Apache Aries – JTA integration Aries contains a JTA Service implementation that uses Geronimo's transaction manager Also provides a TransactionSynchronizationRegistry Aries overrides the OpenEJB transaction manager Use the JTA Service
  • 73. Provide the Tx Manager and Tx Registry This is a clean and well used plug point
  • 74. Issues Running EJBs in OSGi Locating EJBs in OSGi bundles
  • 75. OSGi class loading semantics
  • 81. EJBs and JPA JPA replaced Entity Beans as the persistence strategy for Java EE
  • 82. EJBs have tight integration with JPA Injection via Annotations @PersistenceUnit
  • 83. Injection via XML <persistence-unit-ref> ...
  • 84. JNDI lookup in java:comp/env EJBs may use JPA in two ways Application Managed
  • 86. EJBs and JPA – Application Managed In Application managed JPA the EJB manages lifecycle Responsible for creating and closing EntityManagers
  • 87. Responsible for joining any active transactions Adds a dependency on a named persistence unit Injects or looks up an EntityManagerFactory OpenEJB expects to find, create, and manage any persistence units in persistence.xml ClassLoader problems make this impossible in OSGi
  • 88. Apache Aries – Updates to Aries JPA container Aries JPA normally uses the Meta-Persistence header to locate persistence bundles in the framework
  • 89. Java EE also defines rules for finding persistence.xml WARs in WEB-INF/classes, or in WEB-INF/lib
  • 90. EJB JARs in META-INF Aries JPA already checks for Web-ContextPath Add support for the Export-EJB header too
  • 91. Apache Aries – JPA (Application Managed) Hide META-INF/persistence.xml from OpenEJB Don't put the URL in the EJBModule
  • 92. Override the OpenEJB validation failure, Aries JPA will provide the missing EntityManagerFactory! Listen for the registration of OSGi persistence units If the unit is used by an EJB then bind it into the right place in java:comp/env EJB java:comp Extender
  • 93. EJBs and JPA – Container Managed In Container managed JPA the container manages everything! Tx integration
  • 94. Creating and closing EntityManagers More importantly, the container propagates context Different EJBs that use the same persistence unit in a transaction will get the same EntityManager Aries JPA already supports this mode of operation for blueprint beans and OSGi service lookups
  • 95. Apache Aries – JPA (Container Managed) Replace the existing OpenEJB JPA context registry Check for Aries JPA contexts and OpenEJB contexts
  • 96. Cross register any created contexts so both agree! Listen for the registration of OSGi persistence units If the unit is used as a managed context in an EJB then create an OpenEJB managed EntityManager Register this EntityManager in the relevant part of java:comp/env EJB java:comp Extender
  • 97. Issues Running EJBs in OSGi Locating EJBs in OSGi bundles
  • 98. OSGi class loading semantics
  • 104. Java EE Security Java EE supports role-based authorization On Servlet methods
  • 105. On EJB method calls OpenEJB provides a Security Service plugpoint Allows third party authentication/authorization engines to be used Aries has no security component - any volunteers? OpenEJB can cope without a Security Service
  • 106. No integration at this time
  • 107. Issues Running EJBs in OSGi Locating EJBs in OSGi bundles
  • 108. OSGi class loading semantics
  • 114. Issues with OpenEJB in OSGi OpenEJB makes extensive use of XBean internally to build things This has the option of providing a ClassLoader OpenEJB typically provides none OpenEjbVersion throws an ExceptionInInitializerError Attempts to classpath scan for properties To work around these Aries has to extensively set the Thread Context ClassLoader when starting OpenEJB New JAXB code in OpenEJB needs delegating to a 2.1 JAXB implementation every time we build an app
  • 115. Summary There are a few rough edges Some can easily be remedied in OpenEJB internals Some support is clearly missing, but could be added Security, Messaging, EJB lite Broadly speaking, it works And I can prove it! Apache Aries Blog sample with an EJB implemented comment service!
  • 116. References Apache Aries: http://aries.apache.org/ Tim Ward: @TimothyWard [email_address] OSGi and JPA on YouTube: http://www.youtube.com/user/EnterpriseOSGi For more information on Enterprise OSGi take a look at Enterprise OSGi in Action : http://www.manning.com/cummins