Class CloseableBundleContext

java.lang.Object
org.osgi.test.common.context.CloseableBundleContext
All Implemented Interfaces:
AutoCloseable, InvocationHandler

public class CloseableBundleContext extends Object implements AutoCloseable, InvocationHandler
  • 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

      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
      Specified by:
      invoke in interface InvocationHandler
      Throws:
      Throwable
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • 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)