org.apache.commons.configuration
Class TestJNDIConfiguration.PotentialErrorJNDIConfiguration

java.lang.Object
  extended by org.apache.commons.configuration.event.EventSource
      extended by org.apache.commons.configuration.AbstractConfiguration
          extended by org.apache.commons.configuration.JNDIConfiguration
              extended by org.apache.commons.configuration.TestJNDIConfiguration.PotentialErrorJNDIConfiguration
All Implemented Interfaces:
Configuration
Enclosing class:
TestJNDIConfiguration

public static class TestJNDIConfiguration.PotentialErrorJNDIConfiguration
extends JNDIConfiguration

A special JNDI configuration implementation that can be configured to throw an exception when accessing the base context. Used for testing the exception handling.


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
TestJNDIConfiguration.PotentialErrorJNDIConfiguration(Context ctx)
           
 
Method Summary
 Context getBaseContext()
          Returns the JNDI context.
 void installException()
          Prepares this object to throw a standard exception when the JNDI context is queried.
 void installException(NamingException nex)
          Prepares this object to throw an exception when the JNDI context is queried.
 
Methods inherited from class org.apache.commons.configuration.JNDIConfiguration
addPropertyDirect, clearProperty, containsKey, getContext, getKeys, getKeys, getPrefix, getProperty, isEmpty, setContext, setPrefix, setProperty
 
Methods inherited from class org.apache.commons.configuration.AbstractConfiguration
addErrorLogListener, addProperty, append, clear, clearPropertyDirect, copy, createInterpolator, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDefaultListDelimiter, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getList, getList, getListDelimiter, getLogger, getLong, getLong, getLong, getProperties, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, getSubstitutor, interpolate, interpolate, interpolatedConfiguration, interpolateHelper, isDelimiterParsingDisabled, isScalarValue, isThrowExceptionOnMissing, resolveContainerStore, setDefaultListDelimiter, setDelimiter, setDelimiterParsingDisabled, setListDelimiter, setLogger, setThrowExceptionOnMissing, subset
 
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

TestJNDIConfiguration.PotentialErrorJNDIConfiguration

public TestJNDIConfiguration.PotentialErrorJNDIConfiguration(Context ctx)
                                                      throws NamingException
Throws:
NamingException
Method Detail

installException

public void installException(NamingException nex)
Prepares this object to throw an exception when the JNDI context is queried.

Parameters:
nex - the exception to be thrown

installException

public void installException()
Prepares this object to throw a standard exception when the JNDI context is queried.


getBaseContext

public Context getBaseContext()
                       throws NamingException
Returns the JNDI context. Optionally throws an exception.

Overrides:
getBaseContext in class JNDIConfiguration
Throws:
NamingException


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.