org.hibernate.osgi
Class OsgiSessionFactoryService

java.lang.Object
  extended by org.hibernate.osgi.OsgiSessionFactoryService
All Implemented Interfaces:
org.osgi.framework.ServiceFactory

public class OsgiSessionFactoryService
extends Object
implements org.osgi.framework.ServiceFactory

Hibernate 4.2 and 4.3 still heavily rely on TCCL for ClassLoading. Although our ClassLoaderService removed some of the reliance, the service is unfortunately not available during Configuration. An OSGi bundle manually creating a SessionFactory would require numerous ClassLoader tricks (or may be impossible altogether). In order to fully control the TCCL issues and shield users from the knowledge, we're requiring that bundles use this OSGi ServiceFactory. It configures and provides a SessionFactory as an OSGi service. Note that an OSGi ServiceFactory differs from a Service. The ServiceFactory allows individual instances of Services to be created and provided to multiple client Bundles.


Constructor Summary
OsgiSessionFactoryService(OsgiClassLoader osgiClassLoader, OsgiJtaPlatform osgiJtaPlatform, org.osgi.framework.BundleContext context)
           
 
Method Summary
 Object getService(org.osgi.framework.Bundle requestingBundle, org.osgi.framework.ServiceRegistration registration)
           
 void ungetService(org.osgi.framework.Bundle requestingBundle, org.osgi.framework.ServiceRegistration registration, Object service)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiSessionFactoryService

public OsgiSessionFactoryService(OsgiClassLoader osgiClassLoader,
                                 OsgiJtaPlatform osgiJtaPlatform,
                                 org.osgi.framework.BundleContext context)
Method Detail

getService

public Object getService(org.osgi.framework.Bundle requestingBundle,
                         org.osgi.framework.ServiceRegistration registration)
Specified by:
getService in interface org.osgi.framework.ServiceFactory

ungetService

public void ungetService(org.osgi.framework.Bundle requestingBundle,
                         org.osgi.framework.ServiceRegistration registration,
                         Object service)
Specified by:
ungetService in interface org.osgi.framework.ServiceFactory


Copyright © 2001-2013 Red Hat, Inc. All Rights Reserved.