Class ConfigSharingServiceImpl
- java.lang.Object
-
- org.apache.unomi.services.impl.configsharing.ConfigSharingServiceImpl
-
- All Implemented Interfaces:
EventListener
,ConfigSharingService
,org.osgi.framework.BundleListener
,org.osgi.framework.SynchronousBundleListener
public class ConfigSharingServiceImpl extends Object implements ConfigSharingService, org.osgi.framework.SynchronousBundleListener
An implementation of the ConfigSharingService that supports listeners that will be called when a property is added, updated or removed. The properties are stored in a ConcurrentHashMap so access should be thread-safe.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.unomi.api.services.ConfigSharingService
ConfigSharingService.ConfigChangeEvent, ConfigSharingService.ConfigChangeListener
-
-
Constructor Summary
Constructors Constructor Description ConfigSharingServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bundleChanged(org.osgi.framework.BundleEvent bundleEvent)
Object
getProperty(String name)
Set<String>
getPropertyNames()
boolean
hasProperty(String name)
void
preDestroy()
Object
removeProperty(String name)
void
setBundleContext(org.osgi.framework.BundleContext bundleContext)
void
setConfigProperties(Map<String,Object> configProperties)
Object
setProperty(String name, Object newValue)
-
-
-
Method Detail
-
setBundleContext
public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
-
getProperty
public Object getProperty(String name)
- Specified by:
getProperty
in interfaceConfigSharingService
-
setProperty
public Object setProperty(String name, Object newValue)
- Specified by:
setProperty
in interfaceConfigSharingService
-
hasProperty
public boolean hasProperty(String name)
- Specified by:
hasProperty
in interfaceConfigSharingService
-
removeProperty
public Object removeProperty(String name)
- Specified by:
removeProperty
in interfaceConfigSharingService
-
getPropertyNames
public Set<String> getPropertyNames()
- Specified by:
getPropertyNames
in interfaceConfigSharingService
-
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent bundleEvent)
- Specified by:
bundleChanged
in interfaceorg.osgi.framework.BundleListener
-
-