|
||||||||||
| 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.
| Field Summary | |
|---|---|
static int |
MODIFIED
The modified properties state. |
static int |
SYNCHRONIZED
The synchronized properties state. |
static int |
UNMODIFIED
The unmodified properties state. |
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| 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 |
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. |
int |
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. |
int |
indexOfProperty(String key,
String value)
Returns the index of a multivalued property value. |
Configuration |
loadConfiguration(File file)
Loads a configuration from the specified file. |
Configuration |
loadConfiguration(String path)
Loads a configuration from the specified path. |
Configuration |
loadConfiguration(URL url)
Loads a configuration from the specified URL. |
void |
modified(TraceEvent event)
Notifies the object that the trace has been modified. |
OrderedMap |
propertyMap()
Returns a map of properties. |
OrderedMap |
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 |
setConfigKey(String key)
Sets the path finder key for resolving configuration paths. |
void |
setModifiedState(int 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 encoding. |
void |
storeProperties()
Stores properties to the property file. |
| 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 |
| Field Detail |
|---|
public static final int UNMODIFIED
public static final int MODIFIED
public static final int SYNCHRONIZED
| 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)
Configurable
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 - the encoding to use.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 propertyMap()
Configurable
propertyMap in interface Configurablepublic OrderedMap 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 probe event.public int getModifiedState()
public void setModifiedState(int state)
state - the modified state.public Configuration getConfiguration()
public Configuration loadConfiguration(String path)
path - the path.
public Configuration loadConfiguration(File file)
file - the file.
public Configuration loadConfiguration(URL url)
url - the URL.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||