Package org.apache.felix.utils.service
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 java.lang.Object implements org.osgi.service.cm.ManagedServiceFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
BaseManagedServiceFactory.Pair<U,V>
-
Field Summary
Fields Modifier and Type Field Description private org.osgi.framework.BundleContext
context
static long
DEFAULT_TIMEOUT_BEFORE_INTERRUPT
private java.util.concurrent.atomic.AtomicBoolean
destroyed
private java.util.concurrent.ExecutorService
executor
private java.lang.String
name
private java.util.Map<java.lang.String,BaseManagedServiceFactory.Pair<T,org.osgi.framework.ServiceRegistration>>
services
private long
timeoutBeforeInterrupt
-
Constructor Summary
Constructors Constructor Description BaseManagedServiceFactory(org.osgi.framework.BundleContext context, java.lang.String name)
BaseManagedServiceFactory(org.osgi.framework.BundleContext context, java.lang.String name, long timeoutBeforeInterrupt)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkConfiguration(java.lang.String pid, java.util.Dictionary properties)
void
deleted(java.lang.String pid)
void
destroy()
protected abstract T
doCreate(java.util.Dictionary properties)
protected abstract void
doDestroy(T t)
protected T
doUpdate(T t, java.util.Dictionary properties)
protected abstract java.lang.String[]
getExposedClasses(T t)
java.lang.String
getName()
protected abstract void
info(java.lang.String message, java.lang.Throwable t)
private void
internalDelete(java.lang.String pid)
private void
internalUpdate(java.lang.String pid, java.util.Dictionary properties)
void
updated(java.lang.String pid, java.util.Dictionary properties)
protected abstract void
warn(java.lang.String message, java.lang.Throwable t)
-
-
-
Field Detail
-
DEFAULT_TIMEOUT_BEFORE_INTERRUPT
public static final long DEFAULT_TIMEOUT_BEFORE_INTERRUPT
- See Also:
- Constant Field Values
-
context
private final org.osgi.framework.BundleContext context
-
name
private final java.lang.String name
-
timeoutBeforeInterrupt
private final long timeoutBeforeInterrupt
-
destroyed
private final java.util.concurrent.atomic.AtomicBoolean destroyed
-
executor
private final java.util.concurrent.ExecutorService executor
-
services
private final java.util.Map<java.lang.String,BaseManagedServiceFactory.Pair<T,org.osgi.framework.ServiceRegistration>> services
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceorg.osgi.service.cm.ManagedServiceFactory
-
updated
public void updated(java.lang.String pid, java.util.Dictionary properties) throws org.osgi.service.cm.ConfigurationException
- Specified by:
updated
in interfaceorg.osgi.service.cm.ManagedServiceFactory
- Throws:
org.osgi.service.cm.ConfigurationException
-
deleted
public void deleted(java.lang.String pid)
- Specified by:
deleted
in interfaceorg.osgi.service.cm.ManagedServiceFactory
-
checkConfiguration
protected void checkConfiguration(java.lang.String pid, java.util.Dictionary properties) throws org.osgi.service.cm.ConfigurationException
- Throws:
org.osgi.service.cm.ConfigurationException
-
doCreate
protected abstract T doCreate(java.util.Dictionary properties) throws java.lang.Exception
- Throws:
java.lang.Exception
-
doUpdate
protected T doUpdate(T t, java.util.Dictionary properties) throws java.lang.Exception
- Throws:
java.lang.Exception
-
doDestroy
protected abstract void doDestroy(T t) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getExposedClasses
protected abstract java.lang.String[] getExposedClasses(T t)
-
internalUpdate
private void internalUpdate(java.lang.String pid, java.util.Dictionary properties)
-
internalDelete
private void internalDelete(java.lang.String pid)
-
warn
protected abstract void warn(java.lang.String message, java.lang.Throwable t)
-
info
protected abstract void info(java.lang.String message, java.lang.Throwable t)
-
destroy
public void destroy()
-
-