public class BasicContainerConfig extends Object implements ContainerConfig
| Modifier and Type | Class and Description |
|---|---|
protected class |
BasicContainerConfig.BasicTransaction |
ContainerConfig.ConfigObserver, ContainerConfig.Transaction| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Map<String,Object>> |
config |
protected Set<ContainerConfig.ConfigObserver> |
observers |
CONTAINER_KEY, DEFAULT_CONTAINER, PARENT_KEY| Constructor and Description |
|---|
BasicContainerConfig() |
| Modifier and Type | Method and Description |
|---|---|
void |
addConfigObserver(ContainerConfig.ConfigObserver observer,
boolean notifyNow)
Adds an observer that will be notified when the configuration changes.
|
boolean |
getBool(String container,
String property) |
Collection<String> |
getContainers() |
int |
getInt(String container,
String property) |
<T> List<T> |
getList(String container,
String property) |
<T> Map<String,T> |
getMap(String container,
String property) |
Map<String,Object> |
getProperties(String container)
Fetch all properties for the given container configuration.
|
Object |
getProperty(String container,
String name) |
String |
getString(String container,
String property) |
ContainerConfig.Transaction |
newTransaction()
Creates a new transaction to create, modify or remove containers.
|
protected void |
notifyObservers(Collection<String> changed,
Collection<String> removed)
Notifies the configuration observers that some containers' configurations
have been changed.
|
String |
toString() |
protected final Set<ContainerConfig.ConfigObserver> observers
public Collection<String> getContainers()
getContainers in interface ContainerConfigpublic Map<String,Object> getProperties(String container)
ContainerConfiggetProperties in interface ContainerConfigpublic Object getProperty(String container, String name)
getProperty in interface ContainerConfigpublic String getString(String container, String property)
getString in interface ContainerConfigpublic int getInt(String container, String property)
getInt in interface ContainerConfigpublic boolean getBool(String container, String property)
getBool in interface ContainerConfigpublic <T> List<T> getList(String container, String property)
getList in interface ContainerConfigpublic <T> Map<String,T> getMap(String container, String property)
getMap in interface ContainerConfigpublic void addConfigObserver(ContainerConfig.ConfigObserver observer, boolean notifyNow)
ContainerConfigaddConfigObserver in interface ContainerConfigobserver - The observer to be notified.notifyNow - If true, the observer will receive an immediate
notification for the current configuration.public ContainerConfig.Transaction newTransaction()
ContainerConfignewTransaction in interface ContainerConfigprotected void notifyObservers(Collection<String> changed, Collection<String> removed)
changed - The names of the containers that have been added or changed.removed - The names of the containers that have been removed.Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.