public class OverrideConfigService extends AbstractConfigService
ConfigService
that allows a set of properties to override
properties provided by another parent ConfigService
conn
Constructor and Description |
---|
OverrideConfigService(java.util.Properties overrides,
AppContext c)
Constructs a new
OverrideConfigService that will return
properties specified in overrides if they are present. |
OverrideConfigService(java.util.Properties parent,
java.lang.String config_list,
AppContext c)
Constructs
OverrideConfigService where the override properties are loaded
from a file. |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ConfigServiceListener listener)
register a ConfigServiceListener
|
void |
cleanup()
AppContext is being closed. |
void |
clearServiceProperties()
clear any cached properties.
|
java.util.Properties |
getOverrides() |
java.util.Properties |
getServiceProperties()
return the set of properties defined by the service
|
void |
setProperty(java.lang.String name,
java.lang.String value)
Set a property
This method is for making persistent changes to the configuration.
|
getType, loadFile, processAdditions
getContext, getLogger, resetLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext
public OverrideConfigService(java.util.Properties overrides, AppContext c)
OverrideConfigService
that will return
properties specified in overrides
if they are present.
overrides
does not contain the requested property,
parent
will be used to fetch the requested property.overrides
- a collection of properties that will override properties stored in
parent
c
- AppContextpublic OverrideConfigService(java.util.Properties parent, java.lang.String config_list, AppContext c)
OverrideConfigService
where the override properties are loaded
from a file.parent
- parent Properties
for the overridesconfig_list
- file to loadc
- AppContext
public void clearServiceProperties()
ConfigService
public java.util.Properties getServiceProperties()
ConfigService
public java.util.Properties getOverrides()
public void setProperty(java.lang.String name, java.lang.String value) throws java.lang.UnsupportedOperationException
ConfigService
UnsupportedOperationException
java.lang.UnsupportedOperationException
public void cleanup()
AppContextCleanup
AppContext
is being closed.
Only use this for cleanup that can't be handled by
normal garbage collection or for state which is never returned by reference.public void addListener(ConfigServiceListener listener)
ConfigService