Package org.hibernate.osgi
Class OSGiClassLoaderServiceImpl
- java.lang.Object
-
- org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl
-
- org.hibernate.osgi.OSGiClassLoaderServiceImpl
-
- All Implemented Interfaces:
java.io.Serializable
,ClassLoaderService
,Service
,Stoppable
public class OSGiClassLoaderServiceImpl extends org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl implements ClassLoaderService
The ClassLoaderService that should be used when running in OSGi; this helps for example to load the Services correctly.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.boot.registry.classloading.spi.ClassLoaderService
ClassLoaderService.Work<T>
-
-
Constructor Summary
Constructors Constructor Description OSGiClassLoaderServiceImpl(OsgiClassLoader osgiClassLoader, OsgiServiceUtil osgiServiceUtil)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <S> java.util.LinkedHashSet<S>
loadJavaServices(java.lang.Class<S> serviceContract)
Discovers and instantiates implementations of the named service contract.void
stop()
Stop phase notification-
Methods inherited from class org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl
classForName, fromConfigSettings, generateProxy, locateResource, locateResources, locateResourceStream, workWithClassLoader
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.boot.registry.classloading.spi.ClassLoaderService
classForName, generateProxy, locateResource, locateResources, locateResourceStream, workWithClassLoader
-
-
-
-
Constructor Detail
-
OSGiClassLoaderServiceImpl
public OSGiClassLoaderServiceImpl(OsgiClassLoader osgiClassLoader, OsgiServiceUtil osgiServiceUtil)
-
-
Method Detail
-
loadJavaServices
public <S> java.util.LinkedHashSet<S> loadJavaServices(java.lang.Class<S> serviceContract)
Description copied from interface:ClassLoaderService
Discovers and instantiates implementations of the named service contract. NOTE : the terms service here is used differently thanService
. Instead here we are talking about services as defined byServiceLoader
.- Specified by:
loadJavaServices
in interfaceClassLoaderService
- Overrides:
loadJavaServices
in classorg.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl
- Type Parameters:
S
- The type of the service contract- Parameters:
serviceContract
- The java type defining the service contract- Returns:
- The ordered set of discovered services.
-
-