| java.lang.Object com.sun.jbi.framework.Operation
All known Subclasses: com.sun.jbi.framework.ComponentOperation, com.sun.jbi.framework.ServiceUnitOperation,
Operation | abstract class Operation implements Runnable(Code) | | This is an abstract class that provides a generalized way for the framework
to perform a set of operations on BCs and SEs in parallel on separate
threads. In conjunction with the OperationCounter class, it can wait for
all of the operations to complete, with an optional timeout.
author: Sun Microsystems, Inc. |
Constructor Summary | |
| Operation(OperationCounter counter, Object arguments) Constructor.
Parameters: counter - - the optional OperationCounter instance that should beassociated with this Operation. |
Method Summary | |
final boolean | completed() Returns true if this operation completed. | final Object | getArgument(int index) Returns one argument that was provided to the constructor and passed
to the operation.
Parameters: index - the index of the argument to be returned. | final Object[] | getArguments() Returns the arguments that were provided to the constructor and passed
to the operation. | final Throwable | getException() Returns any exception thrown by the operation, or null if no exception
was thrown. | final Object | getReturnValue() Returns any return value from the operation, or null if there was none. | final Thread | getThread() Returns the thread on which this operation is running. | abstract Object | process(Object arguments) Process the operation. | final void | reset() Reset this instance for a new operation. | final public void | run() Run the operation. |
Operation | Operation(OperationCounter counter, Object arguments)(Code) | | Constructor.
Parameters: counter - - the optional OperationCounter instance that should beassociated with this Operation. If this is not null, its increment()method is called here. Parameters: arguments - - the arguments to be passed to the process() method,which is called to perform the operation. |
completed | final boolean completed()(Code) | | Returns true if this operation completed.
true if the operation has completed, false if it has not. |
getArgument | final Object getArgument(int index)(Code) | | Returns one argument that was provided to the constructor and passed
to the operation.
Parameters: index - the index of the argument to be returned. The argument that was provided to the operation. |
getArguments | final Object[] getArguments()(Code) | | Returns the arguments that were provided to the constructor and passed
to the operation.
The arguments that were provided to the operation. |
getException | final Throwable getException()(Code) | | Returns any exception thrown by the operation, or null if no exception
was thrown.
The exception from the operation or null. |
getReturnValue | final Object getReturnValue()(Code) | | Returns any return value from the operation, or null if there was none.
The return value from the operation or null. |
getThread | final Thread getThread()(Code) | | Returns the thread on which this operation is running.
The thread on which the operation is running. |
process | abstract Object process(Object arguments) throws Throwable(Code) | | Process the operation. This method must be overridden to perform the
desired processing.
Parameters: arguments - the arguments to be provided to the operation. the returned value from the operation as an object or null ifno value was returned. throws: Throwable - if any error occurs. |
reset | final void reset()(Code) | | Reset this instance for a new operation. This clears all results of
a previous operation.
|
run | final public void run()(Code) | | Run the operation. Save the thread on which this operation is running in
case of a timeout, so that the parent thread can interrupt this one.
When the operation completes, save its return value and set the completed
flag. If an OperationCounter is present, decrement its counter. If the
operation throws an exception, save it. Upon return from this method,
this thread terminates.
|
|
|