Class BundleContextImpl

  • All Implemented Interfaces:
    org.osgi.framework.BundleContext, org.osgi.framework.BundleReference

    public class BundleContextImpl
    extends Object
    implements org.osgi.framework.BundleContext
    Author:
    Lyubomir Marinov
    • Method Detail

      • addBundleListener

        public void addBundleListener​(org.osgi.framework.BundleListener listener)
        Specified by:
        addBundleListener in interface org.osgi.framework.BundleContext
      • addFrameworkListener

        public void addFrameworkListener​(org.osgi.framework.FrameworkListener listener)
        Specified by:
        addFrameworkListener in interface org.osgi.framework.BundleContext
      • addServiceListener

        public void addServiceListener​(org.osgi.framework.ServiceListener listener)
        Specified by:
        addServiceListener in interface org.osgi.framework.BundleContext
      • addServiceListener

        public void addServiceListener​(org.osgi.framework.ServiceListener listener,
                                       String filter)
                                throws org.osgi.framework.InvalidSyntaxException
        Specified by:
        addServiceListener in interface org.osgi.framework.BundleContext
        Throws:
        org.osgi.framework.InvalidSyntaxException
      • createFilter

        public org.osgi.framework.Filter createFilter​(String filter)
                                               throws org.osgi.framework.InvalidSyntaxException
        Specified by:
        createFilter in interface org.osgi.framework.BundleContext
        Throws:
        org.osgi.framework.InvalidSyntaxException
      • getBundle

        public BundleImpl getBundle()
        Specified by:
        getBundle in interface org.osgi.framework.BundleContext
        Specified by:
        getBundle in interface org.osgi.framework.BundleReference
      • getBundle

        public org.osgi.framework.Bundle getBundle​(long id)
        Specified by:
        getBundle in interface org.osgi.framework.BundleContext
      • getBundle

        public org.osgi.framework.Bundle getBundle​(String location)
        Specified by:
        getBundle in interface org.osgi.framework.BundleContext
      • getBundles

        public org.osgi.framework.Bundle[] getBundles()
        Specified by:
        getBundles in interface org.osgi.framework.BundleContext
      • getDataFile

        public File getDataFile​(String filename)
        Specified by:
        getDataFile in interface org.osgi.framework.BundleContext
      • getProperty

        public String getProperty​(String key)
        Specified by:
        getProperty in interface org.osgi.framework.BundleContext
      • getService

        public <S> S getService​(org.osgi.framework.ServiceReference<S> reference)
        Specified by:
        getService in interface org.osgi.framework.BundleContext
      • getServiceReference

        public <S> org.osgi.framework.ServiceReference<S> getServiceReference​(Class<S> clazz)
        Specified by:
        getServiceReference in interface org.osgi.framework.BundleContext
      • getServiceReference

        public org.osgi.framework.ServiceReference<?> getServiceReference​(String className)
        Specified by:
        getServiceReference in interface org.osgi.framework.BundleContext
      • getServiceReferences

        public <S> Collection<org.osgi.framework.ServiceReference<S>> getServiceReferences​(Class<S> clazz,
                                                                                           String filter)
                                                                                    throws org.osgi.framework.InvalidSyntaxException
        Specified by:
        getServiceReferences in interface org.osgi.framework.BundleContext
        Throws:
        org.osgi.framework.InvalidSyntaxException
      • getServiceReferences

        public org.osgi.framework.ServiceReference<?>[] getServiceReferences​(String className,
                                                                             String filter)
                                                                      throws org.osgi.framework.InvalidSyntaxException
        Specified by:
        getServiceReferences in interface org.osgi.framework.BundleContext
        Throws:
        org.osgi.framework.InvalidSyntaxException
      • getAllServiceReferences

        public org.osgi.framework.ServiceReference<?>[] getAllServiceReferences​(String className,
                                                                                String filter)
                                                                         throws org.osgi.framework.InvalidSyntaxException
        Specified by:
        getAllServiceReferences in interface org.osgi.framework.BundleContext
        Throws:
        org.osgi.framework.InvalidSyntaxException
      • installBundle

        public org.osgi.framework.Bundle installBundle​(String location)
                                                throws org.osgi.framework.BundleException
        Specified by:
        installBundle in interface org.osgi.framework.BundleContext
        Throws:
        org.osgi.framework.BundleException
      • installBundle

        public org.osgi.framework.Bundle installBundle​(String location,
                                                       InputStream input)
                                                throws org.osgi.framework.BundleException
        Specified by:
        installBundle in interface org.osgi.framework.BundleContext
        Throws:
        org.osgi.framework.BundleException
      • registerService

        public <S> org.osgi.framework.ServiceRegistration<S> registerService​(Class<S> clazz,
                                                                             S service,
                                                                             Dictionary<String,​?> properties)
        Specified by:
        registerService in interface org.osgi.framework.BundleContext
      • registerService

        public <S> org.osgi.framework.ServiceRegistration<S> registerService​(Class<S> clazz,
                                                                             org.osgi.framework.ServiceFactory<S> factory,
                                                                             Dictionary<String,​?> properties)
        Specified by:
        registerService in interface org.osgi.framework.BundleContext
      • registerService

        public org.osgi.framework.ServiceRegistration<?> registerService​(String className,
                                                                         Object service,
                                                                         Dictionary<String,​?> properties)
        Specified by:
        registerService in interface org.osgi.framework.BundleContext
      • registerService

        public org.osgi.framework.ServiceRegistration<?> registerService​(String[] classNames,
                                                                         Object service,
                                                                         Dictionary<String,​?> properties)
        Specified by:
        registerService in interface org.osgi.framework.BundleContext
      • removeBundleListener

        public void removeBundleListener​(org.osgi.framework.BundleListener listener)
        Specified by:
        removeBundleListener in interface org.osgi.framework.BundleContext
      • removeFrameworkListener

        public void removeFrameworkListener​(org.osgi.framework.FrameworkListener listener)
        Specified by:
        removeFrameworkListener in interface org.osgi.framework.BundleContext
      • removeServiceListener

        public void removeServiceListener​(org.osgi.framework.ServiceListener listener)
        Specified by:
        removeServiceListener in interface org.osgi.framework.BundleContext
      • ungetService

        public boolean ungetService​(org.osgi.framework.ServiceReference<?> reference)
        Specified by:
        ungetService in interface org.osgi.framework.BundleContext
      • getServiceObjects

        public <S> org.osgi.framework.ServiceObjects<S> getServiceObjects​(org.osgi.framework.ServiceReference<S> reference)
        Specified by:
        getServiceObjects in interface org.osgi.framework.BundleContext