Skip to main content

Source code revision

svn

summary: Issue #14134: Allow JPA in Java SE mode from OSGi context. We now have introduced a new provider resolver which is part of a new module called
revision: 43268
author: Sahoo
date: 2010-12-01 06:26:39 UTC (3 years)
message: Issue #14134: Allow JPA in Java SE mode from OSGi context.
We now have introduced a new provider resolver which is part of a new module called
osgi-jpa-extension.jar. This resolver is disabled by default, but can be enabled
by configuring org.glassfish.osgjpa.extension.useHybridPersistenceProviderResolver=true in
osgi config file. This provider allows PersistenceProviders to be discovered even though
a provider may not be visible to caller's context class loader as long as the provider is
installed as an OSGi bundle and has a META-INF/services/javax.persistence.spi.PersistenceProvider file.

With this change, user can now do Persistence.createEMF(). A test case to this effect is attached in JIRA.

This new resolver only comes into effect in OSGi environment, as it is set inside the bundle activator
of the new bundle. The reason we separated this into a separate bundle is because deployed OSGi bundles
which get started before autostart/ bundles may use Persistence.createEMF in their activator. If we had
set the resolver in our existing autostart/osgi-jpa.jar, they would not have seen the effect. To ensure,
we set the resolver before any osgi-ed app is executed, we have a dummy Startup service in the new bundle as well.
Change Path Actions
A trunk/v3/osgi-javaee/osgi-jpa-extension
A trunk/v3/osgi-javaee/osgi-jpa-extension/osgi.bundle
A trunk/v3/osgi-javaee/osgi-jpa-extension/pom.xml
A trunk/v3/osgi-javaee/osgi-jpa-extension/src
A trunk/v3/osgi-javaee/osgi-jpa-extension/src/main
A trunk/v3/osgi-javaee/osgi-jpa-extension/src/main/java
A trunk/v3/osgi-javaee/osgi-jpa-extension/src/main/java/org
A trunk/v3/osgi-javaee/osgi-jpa-extension/src/main/java/org/glassfish
A trunk/v3/osgi-javaee/osgi-jpa-extension/src/main/java/org/glassfish/osgijpa
A trunk/v3/osgi-javaee/osgi-jpa-extension/src/main/java/org/glassfish/osgijpa/extension
A trunk/v3/osgi-javaee/osgi-jpa-extension/src/main/java/org/glassfish/osgijpa/extension/HybridPersistenceProviderResolver.java
A trunk/v3/osgi-javaee/osgi-jpa-extension/src/main/java/org/glassfish/osgijpa/extension/JPAStartupService.java
A trunk/v3/osgi-javaee/osgi-jpa-extension/src/main/java/org/glassfish/osgijpa/extension/OSGiJPAExtnBundleActivator.java
M trunk/v3/osgi-javaee/pom.xml
M trunk/v3/osgi-platforms/equinox/src/main/resources/glassfish/osgi/equinox/configuration/config.ini
M trunk/v3/osgi-platforms/felix/src/main/resources/glassfish/osgi/felix/conf/config.properties
M trunk/v3/packager/glassfish-jpa/pom.xml
 
 
Close
loading
Please Confirm
Close