Class HibernateBundleActivator

  • All Implemented Interfaces:
    org.osgi.framework.BundleActivator

    public class HibernateBundleActivator
    extends java.lang.Object
    implements org.osgi.framework.BundleActivator
    This BundleActivator provides three different uses of Hibernate in OSGi environments: 1.) Enterprise OSGi JPA: The OSGi container/runtime is in charge of managing all of the client bundles' persistence units. The container/runtime is also in charge of creating and managing the EntityManagerFactory through a registered PersistenceProvider (this). 2.) Un-managed OSGI JPA: Same as #1, but the container does not manage the persistence units. Client bundles identify a typical PersistenceProvider, registered by this activator. 3.) Client bundles create and manage their own SessionFactory. A SessionFactory is registered as an OSGi ServiceFactory -- each requesting bundle gets its own instance of a SessionFactory. The use of services, rather than manual building of the SessionFactory, is necessary to shield users from ClassLoader issues. See OsgiSessionFactoryService for more information.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void start​(org.osgi.framework.BundleContext context)  
      void stop​(org.osgi.framework.BundleContext context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HibernateBundleActivator

        public HibernateBundleActivator()
    • Method Detail

      • start

        public void start​(org.osgi.framework.BundleContext context)
                   throws java.lang.Exception
        Specified by:
        start in interface org.osgi.framework.BundleActivator
        Throws:
        java.lang.Exception
      • stop

        public void stop​(org.osgi.framework.BundleContext context)
                  throws java.lang.Exception
        Specified by:
        stop in interface org.osgi.framework.BundleActivator
        Throws:
        java.lang.Exception