| java.lang.Object com.sun.jbi.framework.Operation com.sun.jbi.framework.ComponentOperation
ComponentOperation | class ComponentOperation 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 multiple components (BCs and SEs) in parallel, and optionally
wait for all of them to complete.
To use this class, create an instance for each BC or SE, providing the
appropriate Component instances and and operation types to the constructor.
Then, create a thread for each instance and call its start() method.
If the parent thread needs to wait for all of the operations to complete,
a single OperationCounter instance must be created and provided to the
constructor when creating the instances of this class. Then after all of the
threads have been started, the parent thread calls wait() on the instance
of OperationCounter. Optionally, the wait() call can have a timeout parameter
to limit the amount of time the parent thread will wait for completion of
all of the threads.
In the Component Framework, this class is used in conjunction with the
OperationCounter class to multi-thread startup and shutdown of BCs and SEs
during AppServer startup and shutdown. This design prevents an ill-behaved
BC or SE from hanging the AppServer startup or shutdown should the BC or
SE hang.
author: Sun Microsystems, Inc. |
Field Summary | |
final public static int | INITIALIZE Value for mOperation for an initialize operation. | final public static int | SHUTDOWN Value for mOperation for a shutdown operation. | final public static int | STARTUP Value for mOperation for a startup operation. |
Method Summary | |
Component | getComponent() Return the Component instance for which this ComponentOperation was
created. | int | getOperation() Return the operation that this instance represents. | void | init(Component component, int operation) Common constructor initialization code. | Object | process(Object argumentList) Overridden method to call the ComponentFramework to initialize, startup
or shut down the BC or SE.
Parameters: argumentList - the arguments for the operation. |
INITIALIZE | final public static int INITIALIZE(Code) | | Value for mOperation for an initialize operation.
|
SHUTDOWN | final public static int SHUTDOWN(Code) | | Value for mOperation for a shutdown operation.
|
STARTUP | final public static int STARTUP(Code) | | Value for mOperation for a startup operation.
|
ComponentOperation | ComponentOperation(Component component, int operation)(Code) | | Constructor.
Parameters: component - the Component instance that represents the BC or SEto be operated upon. Parameters: operation - the type of operation to be performed, eitherINITIALIZE, STARTUP, or SHUTDOWN. |
ComponentOperation | ComponentOperation(OperationCounter counter, Component component, int operation)(Code) | | Constructor.
Parameters: counter - the OperationCounter instance associated with thisoperation. Parameters: component - the Component instance that represents the BC or SEto be operated upon. Parameters: operation - the type of operation to be performed, eitherINITIALIZE, STARTUP, or SHUTDOWN. |
ComponentOperation | ComponentOperation(OperationCounter counter, Component component, int operation, boolean notify)(Code) | | Constructor.
Parameters: counter - the OperationCounter instance associated with thisoperation. Parameters: component - the Component instance that represents the BC or SEto be operated upon. Parameters: operation - the type of operation to be performed, eitherINITIALIZE, STARTUP, or SHUTDOWN. Parameters: notify - set to True if the framework should notify the adminservice when the operation is complete. |
getComponent | Component getComponent()(Code) | | Return the Component instance for which this ComponentOperation was
created.
the instance of Component for this operation. |
getOperation | int getOperation()(Code) | | Return the operation that this instance represents.
the integer value of the operation code. |
init | void init(Component component, int operation)(Code) | | Common constructor initialization code.
Parameters: component - the Component instance that represents the BC or SEto be operated upon. Parameters: operation - the type of operation to be performed, eitherINITIALIZE, STARTUP, or SHUTDOWN. |
process | Object process(Object argumentList) throws Throwable(Code) | | Overridden method to call the ComponentFramework to initialize, startup
or shut down the BC or SE.
Parameters: argumentList - the arguments for the operation. For this class thisis always null. the returned string from operations that return a string or nullfor operations that have no return value. throws: Throwable - if any error occurs. |
|
|