public abstract class AbstractServiceConfigurationFactory<T> extends Object implements ConfigurationFactory
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractServiceConfigurationFactory.Entry<T> |
Modifier and Type | Field and Description |
---|---|
protected org.osgi.framework.BundleContext |
context |
Constructor and Description |
---|
AbstractServiceConfigurationFactory(org.osgi.framework.BundleContext context) |
AbstractServiceConfigurationFactory(org.osgi.framework.BundleContext context,
boolean canOnlyRecreate) |
Modifier and Type | Method and Description |
---|---|
protected abstract AbstractServiceConfigurationFactory.Entry<T> |
createService(UserInformation userInformation,
String configurationId,
org.osgi.framework.BundleContext context,
Map<String,String> parameters)
Create a new service instance
|
void |
delete(UserInformation userInformation,
String configurationId)
receive configuration delete request
|
void |
dispose() |
protected abstract void |
disposeService(UserInformation userInformation,
String configurationId,
T service)
Dispose a service
|
protected AbstractServiceConfigurationFactory.Entry<T> |
getService(String configurationId) |
protected void |
unregisterService(AbstractServiceConfigurationFactory.Entry<T> entry)
Unregister the service entry with OSGi
|
void |
update(UserInformation userInformation,
String configurationId,
Map<String,String> parameters)
receive configuration update
|
protected abstract AbstractServiceConfigurationFactory.Entry<T> |
updateService(UserInformation userInformation,
String configurationId,
AbstractServiceConfigurationFactory.Entry<T> entry,
Map<String,String> parameters)
Update a service configuration
|
public AbstractServiceConfigurationFactory(org.osgi.framework.BundleContext context)
public AbstractServiceConfigurationFactory(org.osgi.framework.BundleContext context, boolean canOnlyRecreate)
public void dispose()
protected void unregisterService(AbstractServiceConfigurationFactory.Entry<T> entry)
entry
- the entry to unregisterpublic void delete(UserInformation userInformation, String configurationId) throws Exception
ConfigurationFactory
delete
in interface ConfigurationFactory
userInformation
- the principal that performed the change, may be null
configurationId
- the configuration object to changeException
- can be thrown if anything goes wrong changing the configurationpublic void update(UserInformation userInformation, String configurationId, Map<String,String> parameters) throws Exception
ConfigurationFactory
update
in interface ConfigurationFactory
userInformation
- the principal that performed the change, may be null
configurationId
- the configuration object to changeparameters
- the new propertiesException
- can be thrown if anything goes wrong changing the configurationprotected abstract AbstractServiceConfigurationFactory.Entry<T> createService(UserInformation userInformation, String configurationId, org.osgi.framework.BundleContext context, Map<String,String> parameters) throws 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 parametersnull
Exception
- if anything goes wrongprotected abstract void disposeService(UserInformation userInformation, 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, String configurationId, AbstractServiceConfigurationFactory.Entry<T> entry, Map<String,String> parameters) throws 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
changeException
- if anything goes wrongprotected AbstractServiceConfigurationFactory.Entry<T> getService(String configurationId)
Copyright © 2016 Eclipse NeoSCADA Project. All rights reserved.