org.apache.avalon.excalibur.testcase
Class ComponentStateValidator

java.lang.Object
  extended byorg.apache.avalon.excalibur.testcase.ComponentStateValidator

Deprecated. ECM is no longer supported

public final class ComponentStateValidator
extends java.lang.Object

This class provides basic facilities for enforcing Avalon's contracts within your own code. Based on Avalon version from Sandbox.

Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:27 $
Author:
Avalon Development Team

Constructor Summary
ComponentStateValidator(java.lang.Object object)
          Deprecated. Create state validator from object (this can be used for more than just components).
 
Method Summary
 void checkActive()
          Deprecated. Checks to see if the state is active.
 void checkActive(java.lang.String message)
          Deprecated. Checks to see if the state is active.
 void checkComposed()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkComposed(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkConfigured()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkConfigured(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkContextualized()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkContextualized(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkDisposed()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkDisposed(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkInitialized()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkInitialized(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkLogEnabled()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkLogEnabled(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkLoggable()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkLoggable(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkNotAssigned(java.lang.Object object)
          Deprecated. Make sure object has not been assigned yet.
 void checkNotAssigned(java.lang.Object object, java.lang.String message)
          Deprecated. Make sure object has not been assigned yet.
 void checkParameterized()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkParameterized(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkResumed()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkResumed(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkServiced()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkServiced(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkStarted()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkStarted(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkStopped()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkStopped(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 void checkSuspended()
          Deprecated. Throw an exception if the initialization is out of order.
 void checkSuspended(java.lang.String message)
          Deprecated. Throw an exception if the initialization is out of order.
 boolean isActive()
          Deprecated. Checks to see if the state is active, and returns true or false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentStateValidator

public ComponentStateValidator(java.lang.Object object)
Deprecated. 
Create state validator from object (this can be used for more than just components).

Method Detail

checkLogEnabled

public void checkLogEnabled()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the ENABLE_LOGGING state has already been set, if the component implements LogEnabled, and if the state has progressed beyond the Logger stage.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkLogEnabled

public void checkLogEnabled(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the ENABLE_LOGGING state has already been set, if the component implements LogEnabled, and if the state has progressed beyond the Logger stage.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkLoggable

public void checkLoggable()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the SET_LOGGER state has already been set, if the component implements Loggable, and if the state has progressed beyond the Logger stage.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkLoggable

public void checkLoggable(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the SET_LOGGER state has already been set, if the component implements Loggable, and if the state has progressed beyond the Logger stage.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkContextualized

public void checkContextualized()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the CONTEXTUALIZED state has already been set, if the component implements Contextualizable, and if the state has progressed beyond the Context stage.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkContextualized

public void checkContextualized(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the CONTEXTUALIZED state has already been set, if the component implements Contextualizable, and if the state has progressed beyond the Context stage.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkServiced

public void checkServiced()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the SERVICE state has already been set, if the component implements Composable, and if the state has progressed beyond the Configuration stage.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkServiced

public void checkServiced(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the SERVICE state has already been set, if the component implements Composable, and if the state has progressed beyond the Configuration stage.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkComposed

public void checkComposed()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the COMPOSED state has already been set, if the component implements Composable, and if the state has progressed beyond the Configuration stage.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkComposed

public void checkComposed(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the COMPOSED state has already been set, if the component implements Composable, and if the state has progressed beyond the Configuration stage.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkConfigured

public void checkConfigured()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the CONFIGURED state has already been set, if the component implements Configurable, and if the state has progressed beyond the Configuration stage.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkConfigured

public void checkConfigured(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the CONFIGURED state has already been set, if the component implements Configurable, and if the state has progressed beyond the Configuration stage.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkParameterized

public void checkParameterized()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the PARAMETERIZED state has already been set, if the component implements Parameterizable, and if the state has progressed beyond the Parameters stage.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkParameterized

public void checkParameterized(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the PARAMETERIZED state has already been set, if the component implements Parameterizable, and if the state has progressed beyond the Parameters stage.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkInitialized

public void checkInitialized()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the INITIALIZED state has already been set, if the component implements Initializable, and if the state has progressed beyond the initialize stage.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkInitialized

public void checkInitialized(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the INITIALIZED state has already been set, if the component implements Initializable, and if the state has progressed beyond the initialize stage.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkStarted

public void checkStarted()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the STARTED state has already been set, if the component implements Startable, and if the state has progressed beyond the start stage.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkStarted

public void checkStarted(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the STARTED state has already been set, if the component implements Startable, and if the state has progressed beyond the start stage.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkSuspended

public void checkSuspended()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the SUSPENDED state has already been set, if the component implements Suspendable, and if the Component is active.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkSuspended

public void checkSuspended(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the SUSPENDED state has already been set, if the component implements Suspendable, and if the Component is active.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkResumed

public void checkResumed()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the SUSPENDED state has not been set, if the component implements Suspendable, and if the Component is active.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkResumed

public void checkResumed(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the SUSPENDED state has not been set, if the component implements Suspendable, and if the Component is active.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkStopped

public void checkStopped()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the STOPPED state has not been set, if the component implements Startable, and if the Component is active.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkStopped

public void checkStopped(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the STOPPED state has not been set, if the component implements Startable, and if the Component is active.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkDisposed

public void checkDisposed()
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the DISPOSED state has not been set, if the component implements Disposable.

Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkDisposed

public void checkDisposed(java.lang.String message)
Deprecated. 
Throw an exception if the initialization is out of order. It tests to see if the DISPOSED state has not been set, if the component implements Disposable.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkActive

public void checkActive()
Deprecated. 
Checks to see if the state is active.

Throws:
java.lang.IllegalStateException - if the component is not active

checkActive

public void checkActive(java.lang.String message)
Deprecated. 
Checks to see if the state is active.

Parameters:
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the component is not active

isActive

public boolean isActive()
Deprecated. 
Checks to see if the state is active, and returns true or false.

Returns:
true if active, false if not

checkNotAssigned

public void checkNotAssigned(java.lang.Object object)
Deprecated. 
Make sure object has not been assigned yet.

Parameters:
object - to test
Throws:
java.lang.IllegalStateException - if the state is manage out of order

checkNotAssigned

public void checkNotAssigned(java.lang.Object object,
                             java.lang.String message)
Deprecated. 
Make sure object has not been assigned yet.

Parameters:
object - to test
message - the message to include in the thrown exception
Throws:
java.lang.IllegalStateException - if the state is manage out of order


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.