Class FrameworkImpl

  • All Implemented Interfaces:
    Comparable<org.osgi.framework.Bundle>, BundleActivatorHolder, org.osgi.framework.Bundle, org.osgi.framework.launch.Framework

    public class FrameworkImpl
    extends BundleImpl
    implements org.osgi.framework.launch.Framework
    Author:
    Lyubomir Marinov, Pawel Domas
    • Method Detail

      • adapt

        public <A> A adapt​(Class<A> type)
        Specified by:
        adapt in interface org.osgi.framework.Bundle
        Specified by:
        adapt in interface org.osgi.framework.launch.Framework
        Overrides:
        adapt in class BundleImpl
      • addBundleListener

        public void addBundleListener​(BundleImpl origin,
                                      org.osgi.framework.BundleListener listener)
      • addServiceListener

        public void addServiceListener​(BundleImpl origin,
                                       org.osgi.framework.ServiceListener listener,
                                       org.osgi.framework.Filter filter)
      • addFrameworkListener

        public void addFrameworkListener​(org.osgi.framework.FrameworkListener listener)
      • fireBundleEvent

        public void fireBundleEvent​(int type,
                                    org.osgi.framework.Bundle bundle)
      • getBundle

        public BundleImpl getBundle​(long id)
      • getBundles

        public org.osgi.framework.Bundle[] getBundles()
      • getServiceReferences

        public <S> Collection<org.osgi.framework.ServiceReference<S>> getServiceReferences​(BundleImpl origin,
                                                                                           String className,
                                                                                           org.osgi.framework.Filter filter,
                                                                                           boolean checkAssignable)
                                                                                    throws org.osgi.framework.InvalidSyntaxException
        Throws:
        org.osgi.framework.InvalidSyntaxException
      • init

        public void init()
                  throws org.osgi.framework.BundleException
        Specified by:
        init in interface org.osgi.framework.launch.Framework
        Throws:
        org.osgi.framework.BundleException
      • init

        public void init​(org.osgi.framework.FrameworkListener... listeners)
                  throws org.osgi.framework.BundleException
        Specified by:
        init in interface org.osgi.framework.launch.Framework
        Throws:
        org.osgi.framework.BundleException
      • installBundle

        public org.osgi.framework.Bundle installBundle​(BundleImpl origin,
                                                       String location)
                                                throws org.osgi.framework.BundleException
        Throws:
        org.osgi.framework.BundleException
      • registerService

        public <T> org.osgi.framework.ServiceRegistration<T> registerService​(BundleImpl origin,
                                                                             String[] classNames,
                                                                             T service,
                                                                             Dictionary<String,​?> properties)
      • removeBundleListener

        public void removeBundleListener​(BundleImpl origin,
                                         org.osgi.framework.BundleListener listener)
      • removeServiceListener

        public void removeServiceListener​(BundleImpl origin,
                                          org.osgi.framework.ServiceListener listener)
      • removeFrameworkListener

        public void removeFrameworkListener​(org.osgi.framework.FrameworkListener listener)
      • start

        public void start​(int options)
                   throws org.osgi.framework.BundleException
        Specified by:
        start in interface org.osgi.framework.Bundle
        Specified by:
        start in interface org.osgi.framework.launch.Framework
        Overrides:
        start in class BundleImpl
        Throws:
        org.osgi.framework.BundleException
      • startLevelChanged

        public void startLevelChanged​(int oldStartLevel,
                                      int newStartLevel,
                                      org.osgi.framework.FrameworkListener... listeners)
      • startLevelChanging

        public void startLevelChanging​(int oldStartLevel,
                                       int newStartLevel)
      • stateChanged

        protected void stateChanged​(int oldState,
                                    int newState)
        Overrides:
        stateChanged in class BundleImpl
      • stop

        public void stop​(int options)
                  throws org.osgi.framework.BundleException
        Specified by:
        stop in interface org.osgi.framework.Bundle
        Specified by:
        stop in interface org.osgi.framework.launch.Framework
        Overrides:
        stop in class BundleImpl
        Throws:
        org.osgi.framework.BundleException
      • unregisterService

        public void unregisterService​(BundleImpl origin,
                                      org.osgi.framework.ServiceRegistration<?> serviceRegistration)
      • getRegisteredServices

        public org.osgi.framework.ServiceReference<?>[] getRegisteredServices()
        Specified by:
        getRegisteredServices in interface org.osgi.framework.Bundle
        Overrides:
        getRegisteredServices in class BundleImpl
      • waitForStop

        public org.osgi.framework.FrameworkEvent waitForStop​(long timeout)
                                                      throws InterruptedException
        Specified by:
        waitForStop in interface org.osgi.framework.launch.Framework
        Throws:
        InterruptedException