|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.config.DefaultConfigurable
public class DefaultConfigurable
A default implementation of Configurable maintaining its configuration in key/value based properties.
| Nested Class Summary | |
|---|---|
static class |
DefaultConfigurable.Modified
Modified state of properties. |
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Constructor Summary | |
|---|---|
DefaultConfigurable()
Constructs a new configurable MBean. |
|
| Method Summary | |
|---|---|
void |
addProperty(int index,
String key,
String value)
Inserts a multivalued property at the specified index. |
void |
addProperty(String key,
String value)
Adds a multivalued property. |
void |
addPropertyFilePath(String path)
Adds a property file path. |
void |
addPropertyFilePath(String path,
String encoding)
Adds a property file path with an encoding. |
protected void |
checkConfiguration()
Checks the configuration. |
void |
clearProperties()
Clears all properties. |
boolean |
containsProperty(String key)
Checks whether a property is defined. |
String |
getConfigKey()
Gets the path finder key for resolving configuration paths. |
Configuration |
getConfiguration()
Gets the configuration. |
DefaultConfigurable.Modified |
getModifiedState()
Gets the modified state. |
String[] |
getProperties(String key)
Gets a multivalued property. |
String |
getProperty(String key)
Gets a property. |
String |
getPropertyFilePath()
Gets the property file path. |
String[] |
getPropertyFilePaths()
Gets the property file paths. |
int |
indexOfProperty(String key,
String value)
Returns the index of a multivalued property value. |
Configuration |
loadConfiguration(File file,
String... encoding)
Loads a configuration from the specified file. |
Configuration |
loadConfiguration(String path,
String... encoding)
Loads a configuration from the specified path. |
Configuration |
loadConfiguration(URL url,
String... encoding)
Loads a configuration from the specified URL. |
void |
modified(TraceEvent event)
Notifies the object that the trace has been modified. |
OrderedMap<String,Object> |
propertyMap()
Returns a map of properties. |
OrderedMap<String,Object> |
propertyMap(String prefix)
Returns a map of prefixed properties. |
Object |
removeProperty(String key)
Removes a property. |
boolean |
removeProperty(String key,
String value)
Removes a multivalued property. |
void |
removePropertyFilePath(String path)
Removes a property file path. |
void |
setConfigKey(String key)
Sets the path finder key for resolving configuration paths. |
void |
setModifiedState(DefaultConfigurable.Modified state)
Sets the modified state. |
Object |
setProperties(String key,
String[] values)
Sets a multivalued property. |
Object |
setProperty(String key,
String value)
Sets a property. |
void |
setPropertyFilePath(String path)
Sets the property file path. |
void |
setPropertyFilePath(String path,
String encoding)
Sets the property file path with an encoding. |
void |
setPropertyFilePaths(String[] paths)
Sets the property file paths. |
void |
setPropertyFilePaths(String[] paths,
String... encoding)
Sets the property file paths with encodings. |
void |
storeProperties()
Stores properties to the property file. |
protected void |
validateConfiguration(Configuration config)
Validates the configuration. |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unmanaged, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultConfigurable()
| Method Detail |
|---|
public String getConfigKey()
Configurable
getConfigKey in interface Configurablepublic void setConfigKey(String key)
Configurable
setConfigKey in interface Configurablekey - the path finder key.public String getPropertyFilePath()
Configurable
getPropertyFilePath in interface Configurablepublic void setPropertyFilePath(String path)
ConfigurableNote that all previously defined property file paths and properties are cleared.
setPropertyFilePath in interface Configurablepath - a property file path.
public void setPropertyFilePath(String path,
String encoding)
Configurable
setPropertyFilePath in interface Configurablepath - a property file path.encoding - an encoding to use.public String[] getPropertyFilePaths()
Configurable
getPropertyFilePaths in interface Configurablepublic void setPropertyFilePaths(String[] paths)
Configurable
setPropertyFilePaths in interface Configurablepaths - property file paths.
public void setPropertyFilePaths(String[] paths,
String... encoding)
Configurable
setPropertyFilePaths in interface Configurablepaths - property file paths.encoding - encodings to use.public void addPropertyFilePath(String path)
Configurable
addPropertyFilePath in interface Configurablepath - a property file path.
public void addPropertyFilePath(String path,
String encoding)
Configurable
addPropertyFilePath in interface Configurablepath - a property file path.encoding - an encoding to use.public void removePropertyFilePath(String path)
Configurable
removePropertyFilePath in interface Configurablepath - the property file path.public boolean containsProperty(String key)
Configurable
containsProperty in interface Configurablekey - the key.
public String getProperty(String key)
Configurable
getProperty in interface Configurablekey - the key.
public Object setProperty(String key,
String value)
Configurable
setProperty in interface Configurablekey - the key.value - the value.
public String[] getProperties(String key)
Configurable
getProperties in interface Configurablekey - the key.
public Object setProperties(String key,
String[] values)
Configurable
setProperties in interface Configurablekey - the key.values - the values.
public Object removeProperty(String key)
Configurable
removeProperty in interface Configurablekey - the key.
public int indexOfProperty(String key,
String value)
Configurable
indexOfProperty in interface Configurablekey - the key.value - the value.
public void addProperty(String key,
String value)
Configurable
addProperty in interface Configurablekey - the key.value - the property.
public void addProperty(int index,
String key,
String value)
Configurable
addProperty in interface Configurableindex - the index.key - the key.value - the value.
public boolean removeProperty(String key,
String value)
Configurable
removeProperty in interface Configurablekey - the key.value - the value.
public void clearProperties()
Configurable
clearProperties in interface Configurablepublic OrderedMap<String,Object> propertyMap()
Configurable
propertyMap in interface Configurablepublic OrderedMap<String,Object> propertyMap(String prefix)
Configurable
propertyMap in interface Configurableprefix - the prefix.
public void storeProperties()
throws IOException
Configurable
storeProperties in interface ConfigurableIOException - on I/O errors.public void modified(TraceEvent event)
TraceListener
modified in interface TraceListenerevent - the trace event.public DefaultConfigurable.Modified getModifiedState()
public void setModifiedState(DefaultConfigurable.Modified state)
state - the modified state.public Configuration getConfiguration()
public Configuration loadConfiguration(String path,
String... encoding)
throws IOException
path - the path.encoding - an optional encoding.
IOException - on I/O errors.
public Configuration loadConfiguration(File file,
String... encoding)
throws IOException
file - the file.encoding - an optional encoding.
IOException - on I/O errors.
public Configuration loadConfiguration(URL url,
String... encoding)
throws IOException
url - the URL.encoding - an optional encoding.
IOException - on I/O errors.protected void checkConfiguration()
protected void validateConfiguration(Configuration config)
config - the configuration.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||