Package org.hibernate.osgi
Class OsgiServiceUtil
- java.lang.Object
-
- org.hibernate.osgi.OsgiServiceUtil
-
-
Constructor Summary
Constructors Constructor Description OsgiServiceUtil(org.osgi.framework.BundleContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getServiceImpl(java.lang.Class<T> contract)
Locate the single implementor of the given service contract in the given OSGi buindle context.<T> T[]
getServiceImpls(java.lang.Class<T> contract)
Locate all implementors of the given service contract in the given OSGi buindle context.void
stop()
Stop phase notification
-
-
-
Method Detail
-
getServiceImpls
public <T> T[] getServiceImpls(java.lang.Class<T> contract)
Locate all implementors of the given service contract in the given OSGi buindle context. UtilizesServiceTracker
(best practice, automatically handles a lot of boilerplate and error conditions).- Type Parameters:
T
- The Java type of the service to locate- Parameters:
contract
- The service contract for which to locate implementors- Returns:
- All know implementors
-
getServiceImpl
public <T> T getServiceImpl(java.lang.Class<T> contract)
Locate the single implementor of the given service contract in the given OSGi buindle context. UtilizesServiceTracker.waitForService(long)
- Type Parameters:
T
- The Java type of the service to locate- Parameters:
contract
- The service contract for which to locate implementors- Returns:
- All know implementors
-
-