public class ConfigAdminPropertiesFactoryBean extends java.lang.Object implements BundleContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<java.util.Properties>
Configuration,
ConfigurationAdmin,
org.springframework.core.io.support.PropertiesFactoryBean| Modifier and Type | Class and Description |
|---|---|
private class |
ConfigAdminPropertiesFactoryBean.ConfigurationWatcher |
| Modifier and Type | Field and Description |
|---|---|
private org.osgi.framework.BundleContext |
bundleContext |
private boolean |
dynamic |
private boolean |
initLazy |
private long |
initTimeout |
private boolean |
localOverride |
private java.util.Properties |
localProperties |
private static org.apache.commons.logging.Log |
log
logger
|
private java.lang.Object |
monitor |
private java.lang.String |
persistentId |
private java.util.Properties |
properties |
private org.osgi.framework.ServiceRegistration |
registration |
| Constructor and Description |
|---|
ConfigAdminPropertiesFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
private void |
createProperties() |
void |
destroy() |
java.util.Properties |
getObject() |
java.lang.Class<? extends java.util.Properties> |
getObjectType() |
java.lang.String |
getPersistentId()
Returns the persistentId.
|
boolean |
isDynamic()
Indicates whether the returned properties object is dynamic or not.
|
boolean |
isSingleton() |
void |
setBundleContext(org.osgi.framework.BundleContext bundleContext)
Set the
BundleContext that this bean runs in. |
void |
setDynamic(boolean dynamic)
Indicates if the returned configuration is dynamic or static.
|
void |
setInitLazy(boolean initLazy)
Specifies whether the properties reflecting the Configuration Admin service entry will be initialized lazy or
not.
|
void |
setInitTimeout(long initTimeout)
Specifies the amount of time (in milliseconds) the bean factory will wait for the Configuration Admin entry to be
initialized (return a non-null value).
|
void |
setLocalOverride(boolean localOverride)
Sets whether local properties override properties from files.
|
void |
setPersistentId(java.lang.String persistentId)
Sets the ConfigurationAdmin persistent Id that the bean should read.
|
void |
setProperties(java.util.Properties properties)
Sets the local properties, e.g.
|
private static final org.apache.commons.logging.Log log
private volatile java.lang.String persistentId
private volatile java.util.Properties properties
private org.osgi.framework.BundleContext bundleContext
private boolean localOverride
private java.util.Properties localProperties
private volatile boolean dynamic
private volatile org.osgi.framework.ServiceRegistration registration
private boolean initLazy
private long initTimeout
private final java.lang.Object monitor
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic void destroy()
throws java.lang.Exception
destroy in interface org.springframework.beans.factory.DisposableBeanjava.lang.Exceptionprivate void createProperties()
public java.util.Properties getObject()
throws java.lang.Exception
getObject in interface org.springframework.beans.factory.FactoryBean<java.util.Properties>java.lang.Exceptionpublic java.lang.Class<? extends java.util.Properties> getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBean<java.util.Properties>public boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBean<java.util.Properties>public java.lang.String getPersistentId()
public void setPersistentId(java.lang.String persistentId)
persistentId - The persistentId to set.public void setProperties(java.util.Properties properties)
public void setLocalOverride(boolean localOverride)
Default is "false": Properties from the Configuration Admin override local defaults. Can be switched to "true" to let local properties override the Configuration Admin properties.
public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
BundleContextAwareBundleContext that this bean runs in. Normally this can
be used to initialize an object.setBundleContext in interface BundleContextAwarebundleContext - the BundleContext object to be used
by this objectpublic boolean isDynamic()
public void setDynamic(boolean dynamic)
ServicePropertiesChangeListener contract.dynamic - whether the returned object reflects the changes in the configuration admin or not.public void setInitLazy(boolean initLazy)
initLazy - whether or not the bean is lazily initializedpublic void setInitTimeout(long initTimeout)
initTimeout - the amount of time to wait for the entry to be initialized.