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 Object
implements org.osgi.service.cm.ManagedServiceFactory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.osgi.framework.BundleContext
static final long
private final AtomicBoolean
private final ExecutorService
private final String
private final Map
<String, BaseManagedServiceFactory.Pair<T, org.osgi.framework.ServiceRegistration>> private final long
-
Constructor Summary
ConstructorsConstructorDescriptionBaseManagedServiceFactory
(org.osgi.framework.BundleContext context, String name) BaseManagedServiceFactory
(org.osgi.framework.BundleContext context, String name, long timeoutBeforeInterrupt) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkConfiguration
(String pid, Dictionary properties) void
void
destroy()
protected abstract T
doCreate
(Dictionary properties) protected abstract void
protected T
doUpdate
(T t, Dictionary properties) protected abstract String[]
getName()
protected abstract void
private void
internalDelete
(String pid) private void
internalUpdate
(String pid, Dictionary properties) void
updated
(String pid, Dictionary properties) protected abstract void
-
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
-
timeoutBeforeInterrupt
private final long timeoutBeforeInterrupt -
destroyed
-
executor
-
services
private final Map<String,BaseManagedServiceFactory.Pair<T, servicesorg.osgi.framework.ServiceRegistration>>
-
-
Constructor Details
-
BaseManagedServiceFactory
-
BaseManagedServiceFactory
public BaseManagedServiceFactory(org.osgi.framework.BundleContext context, String name, long timeoutBeforeInterrupt)
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceorg.osgi.service.cm.ManagedServiceFactory
-
updated
public void updated(String pid, Dictionary properties) throws org.osgi.service.cm.ConfigurationException - Specified by:
updated
in interfaceorg.osgi.service.cm.ManagedServiceFactory
- Throws:
org.osgi.service.cm.ConfigurationException
-
deleted
- Specified by:
deleted
in interfaceorg.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
- Throws:
Exception
-
doUpdate
- Throws:
Exception
-
doDestroy
- Throws:
Exception
-
getExposedClasses
-
internalUpdate
-
internalDelete
-
warn
-
info
-
destroy
public void destroy()
-