|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.commons.configuration.AbstractConfiguration
org.apache.commons.configuration.JNDIConfiguration
This Configuration class allows you to interface with a JNDI datasource. A JNDIConfiguration is read-only, write operations will throw an UnsupportedOperationException. The clear operations are supported but the underlying JNDI data source is not changed.
| Nested Class Summary |
| Nested classes inherited from class org.apache.commons.configuration.AbstractConfiguration |
AbstractConfiguration.PropertiesTokenizer |
| Field Summary |
| Fields inherited from class org.apache.commons.configuration.AbstractConfiguration |
END_TOKEN, START_TOKEN |
| Constructor Summary | |
JNDIConfiguration()
Creates a JNDIConfiguration using the default initial context as the root of the properties. |
|
JNDIConfiguration(Context context)
Creates a JNDIConfiguration using the specified initial context as the root of the properties. |
|
JNDIConfiguration(Context context,
String prefix)
Creates a JNDIConfiguration using the specified initial context shifted by the specified prefix as the root of the properties. |
|
JNDIConfiguration(String prefix)
Creates a JNDIConfiguration using the default initial context, shifted with the specified prefix, as the root of the properties. |
|
| Method Summary | |
void |
addProperty(String key,
Object token)
JNDIConfigurations can not be added to. |
protected void |
addPropertyDirect(String key,
Object obj)
Adds a key/value pair to the Configuration. Override this method to provide write acces to underlying Configuration store. |
void |
clearProperty(String key)
Remove a property from the configuration. |
boolean |
containsKey(String key)
Check if the configuration contains the specified key. |
Context |
getBaseContext()
Return the base context with the prefix applied. |
Context |
getContext()
Return the initial context used by this configuration. |
Iterator |
getKeys()
Get the list of the keys contained in the configuration. |
Iterator |
getKeys(String prefix)
Get the list of the keys contained in the configuration that match the specified prefix. |
String |
getPrefix()
|
Properties |
getProperties(String key)
Get a list of properties associated with the given configuration key. This operation is not supported |
Object |
getProperty(String key)
Gets a property from the configuration. |
protected Object |
getPropertyDirect(String key)
Read property. Should return null if the key doesn't
map to an existing object. |
boolean |
isEmpty()
Check if the configuration is empty. |
void |
setContext(Context context)
Set the initial context of the configuration. |
void |
setPrefix(String prefix)
Sets the prefix. |
void |
setProperty(String key,
Object value)
Set a property, this will replace any previously set values. Set values is implicitly a call to clearProperty(key), addProperty(key, value). |
| Methods inherited from class org.apache.commons.configuration.AbstractConfiguration |
getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getList, getList, getLong, getLong, getLong, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, getVector, getVector, interpolate, interpolateHelper, isThrowExceptionOnMissing, setDelimiter, setThrowExceptionOnMissing, split, subset |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JNDIConfiguration()
throws NamingException
NamingException - thrown if an error occurs when initializing the default context
public JNDIConfiguration(String prefix)
throws NamingException
prefix -
NamingException - thrown if an error occurs when initializing the default contextpublic JNDIConfiguration(Context context)
context - the initial context
public JNDIConfiguration(Context context,
String prefix)
context - the initial contextprefix - | Method Detail |
public void addProperty(String key,
Object token)
addProperty in interface ConfigurationaddProperty in class AbstractConfigurationkey - The Key to add the property to.token - The Value to add.public Iterator getKeys()
getKeys in interface ConfigurationgetKeys in class AbstractConfigurationpublic Iterator getKeys(String prefix)
getKeys in interface ConfigurationgetKeys in class AbstractConfigurationpublic Properties getProperties(String key)
getProperties in interface ConfigurationgetProperties in class AbstractConfigurationpublic boolean isEmpty()
isEmpty in interface ConfigurationisEmpty in class AbstractConfigurationpublic Object getProperty(String key)
getProperty in interface ConfigurationgetProperty in class AbstractConfiguration
public void setProperty(String key,
Object value)
setProperty in interface ConfigurationsetProperty in class AbstractConfigurationpublic void clearProperty(String key)
clearProperty in interface ConfigurationclearProperty in class AbstractConfigurationpublic boolean containsKey(String key)
containsKey in interface ConfigurationcontainsKey in class AbstractConfigurationpublic String getPrefix()
public void setPrefix(String prefix)
prefix - The prefix to setprotected Object getPropertyDirect(String key)
null if the key doesn't
map to an existing object.
getPropertyDirect in class AbstractConfigurationkey - key to use for mapping
protected void addPropertyDirect(String key,
Object obj)
addPropertyDirect in class AbstractConfigurationkey - key to use for mappingobj - object to store
public Context getBaseContext()
throws NamingException
NamingExceptionpublic Context getContext()
public void setContext(Context context)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||