public class OsgiServiceUtil extends Object implements org.hibernate.service.spi.Stoppable
| Constructor and Description |
|---|
OsgiServiceUtil(org.osgi.framework.BundleContext context) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getServiceImpl(Class<T> contract)
Locate the single implementor of the given service contract in the given OSGi buindle context.
|
<T> T[] |
getServiceImpls(Class<T> contract)
Locate all implementors of the given service contract in the given OSGi buindle context.
|
void |
stop() |
public <T> T[] getServiceImpls(Class<T> contract)
ServiceTracker (best practice, automatically handles a lot of boilerplate and error conditions).contract - The service contract for which to locate implementorscontext - The OSGi bundle contextT[] - The Java type of the service to locatepublic <T> T getServiceImpl(Class<T> contract)
ServiceTracker.waitForService(long)contract - The service contract for which to locate implementorscontext - The OSGi bundle contextT[] - The Java type of the service to locatepublic void stop()
stop in interface org.hibernate.service.spi.StoppableCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.