public abstract class AbstractServiceConfigurationFactory<T> extends java.lang.Object implements ConfigurationFactory
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractServiceConfigurationFactory.Entry<T> |
| Constructor and Description |
|---|
AbstractServiceConfigurationFactory(BundleContext context) |
AbstractServiceConfigurationFactory(BundleContext context,
boolean canOnlyRecreate) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract AbstractServiceConfigurationFactory.Entry<T> |
createService(UserInformation userInformation,
java.lang.String configurationId,
BundleContext context,
java.util.Map<java.lang.String,java.lang.String> parameters)
Create a new service instance
|
void |
delete(UserInformation userInformation,
java.lang.String configurationId)
receive configuration delete request
|
void |
dispose() |
protected abstract void |
disposeService(UserInformation userInformation,
java.lang.String configurationId,
T service)
Dispose a service
|
protected AbstractServiceConfigurationFactory.Entry<T> |
getService(java.lang.String configurationId) |
protected void |
unregisterService(AbstractServiceConfigurationFactory.Entry<T> entry)
Unregister the service entry with OSGi
|
void |
update(UserInformation userInformation,
java.lang.String configurationId,
java.util.Map<java.lang.String,java.lang.String> parameters)
receive configuration update
|
protected abstract AbstractServiceConfigurationFactory.Entry<T> |
updateService(UserInformation userInformation,
java.lang.String configurationId,
AbstractServiceConfigurationFactory.Entry<T> entry,
java.util.Map<java.lang.String,java.lang.String> parameters)
Update a service configuration
|
public AbstractServiceConfigurationFactory(BundleContext context)
public AbstractServiceConfigurationFactory(BundleContext context,
boolean canOnlyRecreate)
public void dispose()
protected void unregisterService(AbstractServiceConfigurationFactory.Entry<T> entry)
entry - the entry to unregisterpublic void delete(UserInformation userInformation,
java.lang.String configurationId)
throws java.lang.Exception
ConfigurationFactorydelete in interface ConfigurationFactoryuserInformation - the principal that performed the change, may be nullconfigurationId - the configuration object to changejava.lang.Exception - can be thrown if anything goes wrong changing the configurationpublic void update(UserInformation userInformation,
java.lang.String configurationId,
java.util.Map<java.lang.String,java.lang.String> parameters)
throws java.lang.Exception
ConfigurationFactoryupdate in interface ConfigurationFactoryuserInformation - the principal that performed the change, may be nullconfigurationId - the configuration object to changeparameters - the new propertiesjava.lang.Exception - can be thrown if anything goes wrong changing the configurationprotected abstract AbstractServiceConfigurationFactory.Entry<T> createService(UserInformation userInformation, java.lang.String configurationId, BundleContext context, java.util.Map<java.lang.String,java.lang.String> parameters) throws java.lang.Exception
The method must also register the service with the OSGi bundle context if needed. The service registration must then be placed into the result that is returned. This is an optional step. There is no need to register the created service.
principal - configurationId - the configuration id for which the service should be createdcontext - the bundle contextparameters - the initial parametersnulljava.lang.Exception - if anything goes wrongprotected abstract void disposeService(UserInformation userInformation,
java.lang.String configurationId,
T service)
If the service entry contains a service handle, the service is automatically unregistered.
userInformation - configurationId - service - protected abstract AbstractServiceConfigurationFactory.Entry<T> updateService(UserInformation userInformation, java.lang.String configurationId, AbstractServiceConfigurationFactory.Entry<T> entry, java.util.Map<java.lang.String,java.lang.String> parameters) throws java.lang.Exception
If a new service entry is returned the old one will get disposed after the call returns
principal - configurationId - the configuration to updateentry - the original service entryparameters - the new parametersnull if the entry did not
changejava.lang.Exception - if anything goes wrongprotected AbstractServiceConfigurationFactory.Entry<T> getService(java.lang.String configurationId)
Copyright (c) IBH SYSTEMS GmbH and others 2010, 2013.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0