Class ServiceRegistry


  • public class ServiceRegistry
    extends java.lang.Object
    • Method Detail

      • registerService

        public ServiceRegistration<?> registerService​(BundleContext context,
                                                      java.lang.String[] classNames,
                                                      java.lang.Object svcObj,
                                                      java.util.Dictionary dict)
      • unregisterServices

        public void unregisterServices​(Bundle bundle)
        This method retrieves all services registrations for the specified bundle and invokes ServiceRegistration.unregister() on each one. This method is only called be the framework to clean up after a stopped bundle.
        Parameters:
        bundle - the bundle whose services should be unregistered.
      • getServiceReferences

        public java.util.Collection getServiceReferences​(java.lang.String className,
                                                         SimpleFilter filter)
      • getService

        public <S> S getService​(Bundle bundle,
                                ServiceReference<S> ref,
                                boolean isServiceObjects)
      • ungetService

        public boolean ungetService​(Bundle bundle,
                                    ServiceReference<?> ref,
                                    java.lang.Object svcObj)
      • ungetServices

        public void ungetServices​(Bundle bundle)
        This is a utility method to release all services being used by the specified bundle.
        Parameters:
        bundle - the bundle whose services are to be released.
      • getLogger

        public Logger getLogger()
      • getHooks

        public <S> java.util.Set<ServiceReference<S>> getHooks​(java.lang.Class<S> hookClass)