javax.persistence.osgi
Class Activator
java.lang.Object
javax.persistence.osgi.Activator
- All Implemented Interfaces:
- PersistenceProviderResolver
public class Activator
- extends java.lang.Object
- implements PersistenceProviderResolver
Uses OSGi services to discover JPA persistence providers
Also acts as a resolver class (called by the Persistence class when resolving
providers).
|
Method Summary |
java.util.List<PersistenceProvider> |
getPersistenceProviders()
Resolve/return existing providers (Implementation method for the
ProviderResolver interface.) |
java.lang.String |
getProviderName(ServiceReference ref)
Assumes that provider services are registered with property that
indicates the name of the provider impl class. |
protected java.util.Map<java.lang.String,PersistenceProvider> |
getProviders()
|
protected void |
removeProvider(ServiceReference ref)
Remove the provider keyed by it's name. |
void |
start(BundleContext context)
|
void |
stop(BundleContext context)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PERSISTENCE_PROVIDER
public static final java.lang.String PERSISTENCE_PROVIDER
- See Also:
- Constant Field Values
Activator
public Activator()
start
public void start(BundleContext context)
throws java.lang.Exception
- Throws:
java.lang.Exception
removeProvider
protected void removeProvider(ServiceReference ref)
- Remove the provider keyed by it's name.
stop
public void stop(BundleContext context)
throws java.lang.Exception
- Throws:
java.lang.Exception
getProviderName
public java.lang.String getProviderName(ServiceReference ref)
- Assumes that provider services are registered with property that
indicates the name of the provider impl class.
getProviders
protected java.util.Map<java.lang.String,PersistenceProvider> getProviders()
getPersistenceProviders
public java.util.List<PersistenceProvider> getPersistenceProviders()
- Resolve/return existing providers (Implementation method for the
ProviderResolver interface.)
- Specified by:
getPersistenceProviders in interface PersistenceProviderResolver
- Returns:
- list of persistence providers available in the environment