org.eclipse.persistence.jpa.osgi.eclipselink
Class Activator

java.lang.Object
  extended by org.eclipse.persistence.jpa.osgi.Activator
      extended by org.eclipse.persistence.jpa.osgi.eclipselink.Activator
All Implemented Interfaces:
EventListener, org.osgi.framework.BundleActivator, org.osgi.framework.BundleListener, org.osgi.framework.SynchronousBundleListener

public class Activator
extends Activator
implements org.osgi.framework.SynchronousBundleListener

Activator for JPA OSGi service. This Activator recieves forwarded events from the activator in org.eclipse.persistence and allows EclipseLink's OSGi behavior to occur in an EclipseLink specific manner as defined in our 2.0 release. When the Eclipse Gemini project comes out of incubation that behavior will be decremented and users will be encouraged to use OSGi JPA in the way defined by the OSGi EE specification

Author:
tware

Field Summary
static String ECLIPSELINK_OSGI_PROVIDER
           
static String MANIFEST_PU_LABEL
           
static String PERSISTENCE_PROVIDER
           
 
Constructor Summary
Activator()
           
 
Method Summary
 void bundleChanged(org.osgi.framework.BundleEvent event)
          Simply add bundles to our bundle list as they start and remove them as they stop
 void registerProviderService(String initializer)
          Our service provider provides the javax.persistence.spi.PersistenceProvider service.
 void start(org.osgi.framework.BundleContext context)
          On start, we do two things We register a listener for bundles and we start our JPA server
 void stop(org.osgi.framework.BundleContext context)
           
 
Methods inherited from class org.eclipse.persistence.jpa.osgi.Activator
getContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MANIFEST_PU_LABEL

public static final String MANIFEST_PU_LABEL
See Also:
Constant Field Values

PERSISTENCE_PROVIDER

public static final String PERSISTENCE_PROVIDER
See Also:
Constant Field Values

ECLIPSELINK_OSGI_PROVIDER

public static final String ECLIPSELINK_OSGI_PROVIDER
See Also:
Constant Field Values
Constructor Detail

Activator

public Activator()
Method Detail

bundleChanged

public void bundleChanged(org.osgi.framework.BundleEvent event)
Simply add bundles to our bundle list as they start and remove them as they stop

Specified by:
bundleChanged in interface org.osgi.framework.BundleListener

start

public void start(org.osgi.framework.BundleContext context)
           throws Exception
On start, we do two things We register a listener for bundles and we start our JPA server

Specified by:
start in interface org.osgi.framework.BundleActivator
Overrides:
start in class Activator
Throws:
Exception

stop

public void stop(org.osgi.framework.BundleContext context)
          throws Exception
Specified by:
stop in interface org.osgi.framework.BundleActivator
Overrides:
stop in class Activator
Throws:
Exception

registerProviderService

public void registerProviderService(String initializer)
                             throws Exception
Our service provider provides the javax.persistence.spi.PersistenceProvider service. In this method, we register as a provider of that service

Throws:
Exception