Class ServiceLoaderImpl

    • Field Detail

      • rwLock

        private java.util.concurrent.locks.ReadWriteLock rwLock
      • bundleTracker

        private org.osgi.framework.BundleListener bundleTracker
      • bundleContext

        private org.osgi.framework.BundleContext bundleContext
    • Constructor Detail

      • ServiceLoaderImpl

        public ServiceLoaderImpl()
    • Method Detail

      • getBundleContextSecured

        private org.osgi.framework.BundleContext getBundleContextSecured​(org.osgi.framework.Bundle bundle)
      • trackBundles

        public void trackBundles()
      • lookupProviderClasses1

        <T> java.lang.Iterable<java.lang.Class> lookupProviderClasses1​(java.lang.Class<T> serviceClass)
        Specified by:
        lookupProviderClasses1 in class ServiceLoader
      • loadClassSecured

        private java.lang.Class loadClassSecured​(org.osgi.framework.Bundle bundle,
                                                 java.lang.String name)
                                          throws java.lang.ClassNotFoundException
        Throws:
        java.lang.ClassNotFoundException
      • isCompatible

        private boolean isCompatible​(java.lang.Class providerClass,
                                     java.lang.Class serviceClass)
      • load

        private java.util.List<java.lang.String> load​(java.io.InputStream is)
                                               throws java.io.IOException
        Loads a single service file and returns the names of the providers. If the same provider appears multiple times, the list contains only one entry for all of the duplicates.
        Returns:
        names of providers, empty list if none is found
        Throws:
        java.io.IOException
      • addProviders

        private void addProviders​(org.osgi.framework.Bundle bundle)
      • removeProviders

        private void removeProviders​(org.osgi.framework.Bundle bundle)
      • debug

        private void debug​(java.lang.String s)
      • debug

        private void debug​(java.lang.String s,
                           java.lang.Throwable t)