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, access to the proper ClassLoader via TCCL is still required in a few cases where we call out to external libs. An OSGi bundle manually creating a SessionFactory would require numerous ClassLoader tricks (or may be impossible altogether). <p/> 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. <p/> 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 and Description |
|---|
OsgiSessionFactoryService(OsgiJtaPlatform osgiJtaPlatform,
OsgiServiceUtil osgiServiceUtil)
Constructs a OsgiSessionFactoryService
|
| Modifier and Type | Method and Description |
|---|---|
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) |
public OsgiSessionFactoryService(OsgiJtaPlatform osgiJtaPlatform, OsgiServiceUtil osgiServiceUtil)
Constructs a OsgiSessionFactoryService
osgiJtaPlatform - The OSGi-specific JtaPlatform created in HibernateBundleActivatorosgiServiceUtil - Util object built in HibernateBundleActivatorpublic Object getService(org.osgi.framework.Bundle requestingBundle, org.osgi.framework.ServiceRegistration registration)
getService in interface org.osgi.framework.ServiceFactorypublic void ungetService(org.osgi.framework.Bundle requestingBundle,
org.osgi.framework.ServiceRegistration registration,
Object service)
ungetService in interface org.osgi.framework.ServiceFactoryCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.