|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.excalibur.testcase.ComponentStateValidator
public final class ComponentStateValidator
This class provides basic facilities for enforcing Avalon's contracts within your own code. Based on Avalon version from Sandbox.
Field Summary | |
---|---|
private static long |
COMPOSABLE
Deprecated. |
private static long |
COMPOSE
Deprecated. |
private static long |
CONFIGURABLE
Deprecated. |
private static long |
CONFIGURE
Deprecated. |
private static long |
CONTEXTUALIZABLE
Deprecated. |
private static long |
CONTEXTUALIZE
Deprecated. |
private static long |
DISPOSABLE
Deprecated. |
private static long |
DISPOSE
Deprecated. |
private static long |
ENABLE_LOGGING
Deprecated. |
private static long |
INIT_COMPLETE
Deprecated. |
private static long |
INIT_MASK
Deprecated. |
private static long |
INITIALIZABLE
Deprecated. |
private static long |
INITIALIZE
Deprecated. |
private static long |
LOG_ENABLED
Deprecated. |
private static long |
LOGGABLE
Deprecated. |
private boolean |
m_active
Deprecated. |
private long |
m_interfaces
Deprecated. |
private long |
m_methods
Deprecated. |
private java.lang.Object |
m_object
Deprecated. |
private long |
m_state
Deprecated. |
private static long |
PARAMETERIZABLE
Deprecated. |
private static long |
PARAMETERIZE
Deprecated. |
private static long |
RECOMPOSABLE
Deprecated. |
private static long |
RECOMPOSE
Deprecated. |
private static long |
RECONFIGURABLE
Deprecated. |
private static long |
RECONFIGURE
Deprecated. |
private static long |
RECONTEXTUALIZABLE
Deprecated. |
private static long |
RECONTEXTUALIZE
Deprecated. |
private static long |
RESUME
Deprecated. |
private static long |
SERVICE
Deprecated. |
private static long |
SERVICEABLE
Deprecated. |
private static long |
SET_LOGGER
Deprecated. |
private static long |
START
Deprecated. |
private static long |
STARTABLE
Deprecated. |
private static long |
STOP
Deprecated. |
private static long |
SUSPEND
Deprecated. |
private static long |
SUSPENDABLE
Deprecated. |
private static java.lang.String |
WRITE_FAIL
Deprecated. |
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. |
private void |
generalCheckActive(java.lang.String message,
long interfaceId,
long methodId)
Deprecated. Active Service methods may only be called after all of the Initialization methods have been called, any before any of the Descruction methods have been called. |
private void |
generalCheckDest(java.lang.String message,
long interfaceId,
long methodId)
Deprecated. Descruction Methods must be called in order. |
private void |
generalCheckInit(java.lang.String message,
long interfaceId,
long methodId)
Deprecated. Initialization methods must be called in order, must all be called, may not be called more than once, and may not be called once any of the Descruction methods have been called. |
private void |
generalCheckInitComplete()
Deprecated. Test to see if this was the last initialization method. |
private java.lang.String |
getInterfaceName(long interfaceId)
Deprecated. |
private java.lang.String |
getLastMethod(long state)
Deprecated. |
private java.lang.String |
getMethodName(long methodId)
Deprecated. |
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 |
Field Detail |
---|
private static final java.lang.String WRITE_FAIL
private static final long LOG_ENABLED
private static final long LOGGABLE
private static final long CONTEXTUALIZABLE
private static final long COMPOSABLE
private static final long SERVICEABLE
private static final long CONFIGURABLE
private static final long PARAMETERIZABLE
private static final long INITIALIZABLE
private static final long STARTABLE
private static final long SUSPENDABLE
private static final long RECONTEXTUALIZABLE
private static final long RECOMPOSABLE
private static final long RECONFIGURABLE
private static final long DISPOSABLE
private static final long ENABLE_LOGGING
private static final long SET_LOGGER
private static final long CONTEXTUALIZE
private static final long SERVICE
private static final long COMPOSE
private static final long CONFIGURE
private static final long PARAMETERIZE
private static final long INITIALIZE
private static final long START
private static final long INIT_COMPLETE
private static final long SUSPEND
private static final long RECONTEXTUALIZE
private static final long RECOMPOSE
private static final long RECONFIGURE
private static final long RESUME
private static final long STOP
private static final long DISPOSE
private static final long INIT_MASK
private final long m_interfaces
private final long m_methods
private long m_state
private boolean m_active
private final java.lang.Object m_object
Constructor Detail |
---|
public ComponentStateValidator(java.lang.Object object)
Method Detail |
---|
private java.lang.String getInterfaceName(long interfaceId)
private java.lang.String getMethodName(long methodId)
private java.lang.String getLastMethod(long state)
private void generalCheckInitComplete()
private void generalCheckInit(java.lang.String message, long interfaceId, long methodId)
private void generalCheckActive(java.lang.String message, long interfaceId, long methodId)
private void generalCheckDest(java.lang.String message, long interfaceId, long methodId)
public void checkLogEnabled()
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkLogEnabled(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkLoggable()
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkLoggable(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkContextualized()
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkContextualized(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkServiced()
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkServiced(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkComposed()
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkComposed(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkConfigured()
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkConfigured(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkParameterized()
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkParameterized(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkInitialized()
initialize
stage.
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkInitialized(java.lang.String message)
initialize
stage.
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkStarted()
start
stage.
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkStarted(java.lang.String message)
start
stage.
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkSuspended()
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkSuspended(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkResumed()
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkResumed(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkStopped()
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkStopped(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkDisposed()
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkDisposed(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkActive()
java.lang.IllegalStateException
- if the component is not activepublic void checkActive(java.lang.String message)
message
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the component is not activepublic boolean isActive()
true
if active, false
if notpublic void checkNotAssigned(java.lang.Object object)
object
- to test
java.lang.IllegalStateException
- if the state is manage out of orderpublic void checkNotAssigned(java.lang.Object object, java.lang.String message)
object
- to testmessage
- the message to include in the thrown exception
java.lang.IllegalStateException
- if the state is manage out of order
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |