public abstract class BaseManagedServiceFactory<T>
extends java.lang.Object
implements org.osgi.service.cm.ManagedServiceFactory
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
BaseManagedServiceFactory.Pair<U,V> |
| Modifier and Type | Field and 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 and Description |
|---|
BaseManagedServiceFactory(org.osgi.framework.BundleContext context,
java.lang.String name) |
BaseManagedServiceFactory(org.osgi.framework.BundleContext context,
java.lang.String name,
long timeoutBeforeInterrupt) |
| Modifier and Type | Method and 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) |
public static final long DEFAULT_TIMEOUT_BEFORE_INTERRUPT
private final org.osgi.framework.BundleContext context
private final java.lang.String name
private final long timeoutBeforeInterrupt
private final java.util.concurrent.atomic.AtomicBoolean destroyed
private final java.util.concurrent.ExecutorService executor
private final java.util.Map<java.lang.String,BaseManagedServiceFactory.Pair<T,org.osgi.framework.ServiceRegistration>> services
public BaseManagedServiceFactory(org.osgi.framework.BundleContext context,
java.lang.String name)
public BaseManagedServiceFactory(org.osgi.framework.BundleContext context,
java.lang.String name,
long timeoutBeforeInterrupt)
public java.lang.String getName()
getName in interface org.osgi.service.cm.ManagedServiceFactorypublic void updated(java.lang.String pid,
java.util.Dictionary properties)
throws org.osgi.service.cm.ConfigurationException
updated in interface org.osgi.service.cm.ManagedServiceFactoryorg.osgi.service.cm.ConfigurationExceptionpublic void deleted(java.lang.String pid)
deleted in interface org.osgi.service.cm.ManagedServiceFactoryprotected void checkConfiguration(java.lang.String pid,
java.util.Dictionary properties)
throws org.osgi.service.cm.ConfigurationException
org.osgi.service.cm.ConfigurationExceptionprotected abstract T doCreate(java.util.Dictionary properties) throws java.lang.Exception
java.lang.Exceptionprotected T doUpdate(T t, java.util.Dictionary properties) throws java.lang.Exception
java.lang.Exceptionprotected abstract void doDestroy(T t) throws java.lang.Exception
java.lang.Exceptionprotected abstract java.lang.String[] getExposedClasses(T t)
private void internalUpdate(java.lang.String pid,
java.util.Dictionary properties)
private void internalDelete(java.lang.String pid)
protected abstract void warn(java.lang.String message,
java.lang.Throwable t)
protected abstract void info(java.lang.String message,
java.lang.Throwable t)
public void destroy()