Package org.osgi.test.common.context
Class CloseableBundleContext
java.lang.Object
org.osgi.test.common.context.CloseableBundleContext
- All Implemented Interfaces:
AutoCloseable,InvocationHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBundleListener(org.osgi.framework.BundleListener listener) voidaddFrameworkListener(org.osgi.framework.FrameworkListener listener) voidaddServiceListener(org.osgi.framework.ServiceListener listener) voidaddServiceListener(org.osgi.framework.ServiceListener listener, String filter) voidclose()<S> SgetService(org.osgi.framework.ServiceReference<S> reference) <S> org.osgi.framework.ServiceObjects<S>getServiceObjects(org.osgi.framework.ServiceReference<S> reference) org.osgi.framework.BundleinstallBundle(String location) org.osgi.framework.BundleinstallBundle(String location, InputStream input) static org.osgi.framework.BundleContextproxy(org.osgi.framework.BundleContext bundleContext) <S> org.osgi.framework.ServiceRegistration<S>registerService(Class<S> clazz, org.osgi.framework.ServiceFactory<S> factory, Dictionary<String, ?> properties) <S> org.osgi.framework.ServiceRegistration<S>registerService(Class<S> clazz, S service, Dictionary<String, ?> properties) org.osgi.framework.ServiceRegistration<?>registerService(String[] clazzes, Object service, Dictionary<String, ?> properties) org.osgi.framework.ServiceRegistration<?>registerService(String clazz, Object service, Dictionary<String, ?> properties) voidremoveBundleListener(org.osgi.framework.BundleListener listener) voidremoveFrameworkListener(org.osgi.framework.FrameworkListener listener) voidremoveServiceListener(org.osgi.framework.ServiceListener listener) booleanungetService(org.osgi.framework.ServiceReference<?> reference)
-
Constructor Details
-
CloseableBundleContext
public CloseableBundleContext(org.osgi.framework.BundleContext bundleContext)
-
-
Method Details
-
proxy
public static org.osgi.framework.BundleContext proxy(org.osgi.framework.BundleContext bundleContext) -
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
installBundle
public org.osgi.framework.Bundle installBundle(String location, InputStream input) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
installBundle
public org.osgi.framework.Bundle installBundle(String location) throws org.osgi.framework.BundleException - Throws:
org.osgi.framework.BundleException
-
addServiceListener
public void addServiceListener(org.osgi.framework.ServiceListener listener, String filter) throws org.osgi.framework.InvalidSyntaxException - Throws:
org.osgi.framework.InvalidSyntaxException
-
addServiceListener
public void addServiceListener(org.osgi.framework.ServiceListener listener) -
removeServiceListener
public void removeServiceListener(org.osgi.framework.ServiceListener listener) -
addBundleListener
public void addBundleListener(org.osgi.framework.BundleListener listener) -
removeBundleListener
public void removeBundleListener(org.osgi.framework.BundleListener listener) -
addFrameworkListener
public void addFrameworkListener(org.osgi.framework.FrameworkListener listener) -
removeFrameworkListener
public void removeFrameworkListener(org.osgi.framework.FrameworkListener listener) -
getService
public <S> S getService(org.osgi.framework.ServiceReference<S> reference) -
getServiceObjects
public <S> org.osgi.framework.ServiceObjects<S> getServiceObjects(org.osgi.framework.ServiceReference<S> reference) -
registerService
public org.osgi.framework.ServiceRegistration<?> registerService(String[] clazzes, Object service, Dictionary<String, ?> properties) -
registerService
public org.osgi.framework.ServiceRegistration<?> registerService(String clazz, Object service, Dictionary<String, ?> properties) -
registerService
public <S> org.osgi.framework.ServiceRegistration<S> registerService(Class<S> clazz, S service, Dictionary<String, ?> properties) -
registerService
public <S> org.osgi.framework.ServiceRegistration<S> registerService(Class<S> clazz, org.osgi.framework.ServiceFactory<S> factory, Dictionary<String, ?> properties) -
ungetService
public boolean ungetService(org.osgi.framework.ServiceReference<?> reference)
-