Class BaseManagedServiceFactory<T>

java.lang.Object
org.apache.felix.utils.service.BaseManagedServiceFactory<T>
All Implemented Interfaces:
org.osgi.service.cm.ManagedServiceFactory

public abstract class BaseManagedServiceFactory<T> extends Object implements org.osgi.service.cm.ManagedServiceFactory
  • Field Details

    • DEFAULT_TIMEOUT_BEFORE_INTERRUPT

      public static final long DEFAULT_TIMEOUT_BEFORE_INTERRUPT
      See Also:
    • context

      private final org.osgi.framework.BundleContext context
    • name

      private final String name
    • timeoutBeforeInterrupt

      private final long timeoutBeforeInterrupt
    • destroyed

      private final AtomicBoolean destroyed
    • executor

      private final ExecutorService executor
    • services

      private final Map<String,BaseManagedServiceFactory.Pair<T,org.osgi.framework.ServiceRegistration>> services
  • Constructor Details

    • BaseManagedServiceFactory

      public BaseManagedServiceFactory(org.osgi.framework.BundleContext context, String name)
    • BaseManagedServiceFactory

      public BaseManagedServiceFactory(org.osgi.framework.BundleContext context, String name, long timeoutBeforeInterrupt)
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface org.osgi.service.cm.ManagedServiceFactory
    • updated

      public void updated(String pid, Dictionary properties) throws org.osgi.service.cm.ConfigurationException
      Specified by:
      updated in interface org.osgi.service.cm.ManagedServiceFactory
      Throws:
      org.osgi.service.cm.ConfigurationException
    • deleted

      public void deleted(String pid)
      Specified by:
      deleted in interface org.osgi.service.cm.ManagedServiceFactory
    • checkConfiguration

      protected void checkConfiguration(String pid, Dictionary properties) throws org.osgi.service.cm.ConfigurationException
      Throws:
      org.osgi.service.cm.ConfigurationException
    • doCreate

      protected abstract T doCreate(Dictionary properties) throws Exception
      Throws:
      Exception
    • doUpdate

      protected T doUpdate(T t, Dictionary properties) throws Exception
      Throws:
      Exception
    • doDestroy

      protected abstract void doDestroy(T t) throws Exception
      Throws:
      Exception
    • getExposedClasses

      protected abstract String[] getExposedClasses(T t)
    • internalUpdate

      private void internalUpdate(String pid, Dictionary properties)
    • internalDelete

      private void internalDelete(String pid)
    • warn

      protected abstract void warn(String message, Throwable t)
    • info

      protected abstract void info(String message, Throwable t)
    • destroy

      public void destroy()