| java.lang.Object com.sun.jbi.framework.Operation com.sun.jbi.framework.ServiceUnitOperation
ServiceUnitOperation | class ServiceUnitOperation extends Operation (Code) | | This class extends the Operation abstract class, and is designed to run on a
separate thread. The main purpose of this class is to provide a way to run
operations on Service Units with a timeout to prevent a hang if the call to
the component's ServiceUnitManager fails to return
To use this class, create an instance for the Service Unit, providing the
appropriate Service Unit Manager, operation type, and operation arguments to
the constructor. Then create a thread for the instance and call its start()
method.
If the parent thread needs to wait for the operation to complete, it can call
wait() on the instance of this class. Optionally, the wait() call can have a
a timeout parameter to limit the amount of time to wait for completion of the
operation.
author: Sun Microsystems, Inc. |
Field Summary | |
final public static int | DEPLOY Value for mOperation for a deploy operation. | final public static int | INIT Value for mOperation for an init operation. | final public static int | SHUTDOWN Value for mOperation for a shutdown operation. | final public static int | START Value for mOperation for a start operation. | final public static int | STOP Value for mOperation for a stop operation. | final public static int | UNDEPLOY Value for mOperation for an undeploy operation. |
Method Summary | |
Object | process(Object argumentList) Call the ServiceUnitManager to perform the operation on the Service Unit.
Parameters: argumentList - - the arguments for the operation provided to theconstructor. | void | resetOperation(int operation) Reset the instance with a new operation. |
DEPLOY | final public static int DEPLOY(Code) | | Value for mOperation for a deploy operation.
|
INIT | final public static int INIT(Code) | | Value for mOperation for an init operation.
|
SHUTDOWN | final public static int SHUTDOWN(Code) | | Value for mOperation for a shutdown operation.
|
START | final public static int START(Code) | | Value for mOperation for a start operation.
|
STOP | final public static int STOP(Code) | | Value for mOperation for a stop operation.
|
UNDEPLOY | final public static int UNDEPLOY(Code) | | Value for mOperation for an undeploy operation.
|
ServiceUnitOperation | ServiceUnitOperation(OperationCounter counter, String compName, ServiceUnitManager suManager, int operation, Object args)(Code) | | Constructor.
Parameters: counter - the OperationCounter for synchronization of the operation. Parameters: compName - the name of the component. Parameters: suManager - the ServiceUnitManager instance for the component. Parameters: operation - the type of operation to be performed, either DEPLOY,INIT, START, STOP, SHUTDOWN, or UNDEPLOY. Parameters: args - array of arguments for the operation. |
process | Object process(Object argumentList) throws Throwable(Code) | | Call the ServiceUnitManager to perform the operation on the Service Unit.
Parameters: argumentList - - the arguments for the operation provided to theconstructor. the returned string from operations that return a string or nullfor operations that have no return value. throws: Throwable - if any error occurs. |
resetOperation | void resetOperation(int operation)(Code) | | Reset the instance with a new operation. Values must be either DEPLOY,
INIT, START, STOP, SHUTDOWN, or UNDEPLOY. This method reinitializes the
instance to reuse for another operation.
Parameters: operation - the type of operation to be performed, either DEPLOY,INIT, START, STOP, SHUTDOWN, or UNDEPLOY. |
|
|