1 / 22

EclipseLink OSGi

EclipseLink OSGi. OSGi Concepts. Multiple Versions Allows multiple versions of the same code to be deployed and provides a mechanism to find the required version Bundle Roughly equivalent to a JAR file

Download Presentation

EclipseLink OSGi

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EclipseLink OSGi

  2. OSGi Concepts • Multiple Versions • Allows multiple versions of the same code to be deployed and provides a mechanism to find the required version • Bundle • Roughly equivalent to a JAR file • Bundle manifest describes the bundle to the Framework, Identity, version, dependencies, exports etc • Fragment • Allows new functionality to be “attached” to a bundle • Activator • When a bundle starts, if it has an activator it is run • Services • OSGi Provides a service registry

  3. EclipseLink OSGi Functionality • JAXB • SDO • JPA • EclipseLink 2.1 contains 2 OSGi implementations • Home-grown support from our 2.0 release • Dynamic weaving support on Equinox • Persistence Units may span bundles • Gemini • Eclipse Project implementing OSGi Enterprise Specification • OSGi Spec-based JPA • Dynamic weaving work in progress

  4. Core EclipseLink OSGi Packaging EclipseLink is available as a set of OSGi bundles: JPA org.eclipse.persistence.jpa—JPA implementation org.eclipse.persistence.antlr—JPQL parsing org.eclipse.persistence.asm—Byte code manipulation MOXy JAXB org.eclipse.persistence.moxy—OXM/JAXB implementation SDO org.eclipse.persistence.sdo—SDO implementation Core (used by all persistence services) org.eclipse.persistence.core—shared infrastructure

  5. Gemini and EclipseLink • Additional Bundles • javax.persistence 2.0 • Gemini version • JDBC driver bundle following OSGi Enterprise specification • Gemini Bundle

  6. Gemini OSGi Example ClientBundle PersistenceBundle 'Accounting' Entity Manager Factory Service?

  7. Gemini OSGi Example ClientBundle PersistenceBundle 'Accounting' Entity Manager Factory Service?

  8. Gemini OSGi Example ClientBundle PersistenceBundle JPA ProviderBundle JPA Provider Bundle Started 'Accounting' Entity Manager Factory Service?

  9. Gemini OSGi Example ClientBundle PersistenceBundle JPA ProviderBundle Detect & Process Persistence Descriptor 'Accounting' Entity Manager Factory Service?

  10. Gemini OSGi Example 'Accounting' PU with required data source declared ClientBundle PersistenceBundle JPA ProviderBundle 'Accounting' Entity Manager Factory Service?

  11. Gemini OSGi Example ClientBundle PersistenceBundle JPA ProviderBundle 'Accounting' Entity Manager Factory Service? JDBC Data Source for 'Accounting' PU?

  12. Gemini OSGi Example ClientBundle PersistenceBundle JPA ProviderBundle 'Accounting' Entity Manager Factory Service? JDBC Data Source for 'Accounting' PU?

  13. Gemini OSGi Example JDBC Driver Bundle Started JDBC ProviderBundle ClientBundle PersistenceBundle JPA ProviderBundle 'Accounting' Entity Manager Factory Service? JDBC Data Source for 'Accounting' PU?

  14. Gemini OSGi Example Data Source Service Published JDBC ProviderBundle ClientBundle PersistenceBundle JPA ProviderBundle JDBC Data Source Service 'Accounting' Entity Manager Factory Service? JDBC Data Source for 'Accounting' PU?

  15. Gemini OSGi Example JDBC ProviderBundle ClientBundle PersistenceBundle JPA ProviderBundle JDBC Data Source Service 'Accounting' Entity Manager Factory Service? JDBC Data Source for 'Accounting' PU?

  16. Gemini OSGi Example ClientBundle PersistenceBundle JPA ProviderBundle JDBC ProviderBundle JDBC Data Source Service 'Accounting' Entity Manager Factory Service? 'Accounting' Entity Manager Factory Service Entity Manager Factory Service Published

  17. Gemini OSGi Example ClientBundle PersistenceBundle JPA ProviderBundle JDBC ProviderBundle JDBC Data Source Service 'Accounting' Entity Manager Factory Service? 'Accounting' Entity Manager Factory Service

  18. Gemini OSGi Example ClientBundle PersistenceBundle JPA ProviderBundle JDBC ProviderBundle JDBC Data Source Service Obtain Entity Manager Factory from service 'Accounting' Entity Manager Factory Service

  19. What do I need to know • Manifests • All EclipseLink bundles have OSGi manifests that describe their dependencies • Activators • org.eclipse.persistence.jpa • Provides functionality for pre-Gemini • Advertises persistence provider serivce • Sets up initialization • javax.persistence • Sets provider resolver • Advertises service in pre-gemini implementation • Fragments • Several fragments used to alter the behavior in certain situations • Equinox weaving (includes hook into Equinox) • Switching between Gemini and pre-Gemini functionality • Oracle-specific Platform classes

  20. Gotchas/Challenges • Packages must be completely contained in the same bundle • Exception: Fragments may extend a package • Must use the correct class loader • ClassLoader is passed in to EclipseLink • In absence of available loader, “loader that loaded this class” can sometimes work • In Gemini, persistence unit must be contained in same bundle • PDE quirkiness • Manifest coordination • BND • PDE/PDE Build • JEE/OSGi versioning practices

  21. Pre-Gemini OSGi Config • Additional Bundles • javax.persistence 2.0 • Must use javax.persistence bundle from EclipseLink repository • org.eclipse.persistence.jpa.osgi • New fragment in 2.1 Required to run in pre-gemini mode • DB Driver bundle • Bundle that makes DB driver code available • org.eclipse.persistence.equinox • Byte code weaving Fragment for Equinox • org.eclipse.persistence.equinox.weaving • Byte code weaving Fragment for Equinox • http://fisheye2.atlassian.com/browse/eclipselink/trunk/examples/org.eclipse.persistence.example.jpa.rcp.comics/ReadMe.txt

  22. Future Directions • Weaving • Enable weaving in Gemini • Weaving for OSGi implementations other than Equinox • Testing • Stronger JPA OSGi testing story • Automated testing of JAXB and SDO • Mindshare • Committers understand OSGi basics and code with OSGi in mind

More Related