|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.commons.configuration.event.EventSource
org.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.
| Field Summary |
| Fields inherited from class org.apache.commons.configuration.AbstractConfiguration |
END_TOKEN, EVENT_ADD_PROPERTY, EVENT_CLEAR, EVENT_CLEAR_PROPERTY, EVENT_READ_PROPERTY, EVENT_SET_PROPERTY, 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 | |
protected void |
addPropertyDirect(String key,
Object obj)
This operation is not supported and will throw an UnsupportedOperationException. |
void |
clearProperty(String key)
Removes the specified property. |
boolean |
containsKey(String key)
Checks whether the specified key is contained in this configuration. |
Context |
getBaseContext()
Return the base context with the prefix applied. |
Context |
getContext()
Return the initial context used by this configuration. |
Iterator |
getKeys()
Returns an iterator with all property keys stored in this configuration. |
Iterator |
getKeys(String prefix)
Returns an iterator with all property keys starting with the given prefix. |
String |
getPrefix()
Returns the prefix. |
Object |
getProperty(String key)
Returns the value of the specified property. |
boolean |
isEmpty()
Returns a flag whether this 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)
This operation is not supported and will throw an UnsupportedOperationException. |
| Methods inherited from class org.apache.commons.configuration.event.EventSource |
addConfigurationListener, addErrorListener, clearConfigurationListeners, clearErrorListeners, clone, createErrorEvent, createEvent, fireError, fireEvent, getConfigurationListeners, getErrorListeners, isDetailEvents, removeConfigurationListener, removeErrorListener, setDetailEvents |
| Methods inherited from class java.lang.Object |
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 - the 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 - the prefix| Method Detail |
public Iterator getKeys()
public Iterator getKeys(String prefix)
getKeys in interface ConfigurationgetKeys in class AbstractConfigurationprefix - the prefix
public boolean isEmpty()
public void setProperty(String key,
Object value)
This operation is not supported and will throw an UnsupportedOperationException.
setProperty in interface ConfigurationsetProperty in class AbstractConfigurationkey - the keyvalue - the value
UnsupportedOperationExceptionpublic void clearProperty(String key)
clearProperty in interface ConfigurationclearProperty in class AbstractConfigurationkey - the key of the property to removepublic boolean containsKey(String key)
key - the key to check
public String getPrefix()
public void setPrefix(String prefix)
prefix - The prefix to setpublic Object getProperty(String key)
key - the key of the property
protected void addPropertyDirect(String key,
Object obj)
This operation is not supported and will throw an UnsupportedOperationException.
addPropertyDirect in class AbstractConfigurationkey - the keyobj - the value
UnsupportedOperationException
public Context getBaseContext()
throws NamingException
NamingException - if an error occurspublic Context getContext()
public void setContext(Context context)
context - the context
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||