public class OsgiServiceUtil
extends java.lang.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(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() |
public <T> T[] getServiceImpls(java.lang.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(java.lang.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.Stoppable
Copyright © 2001-2019 Red Hat, Inc. All Rights Reserved.