| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|
com.newstep.solid.management.runtime
public class ExecStateFuture
Provides a mechanism for synchronously waiting for an ManagedExecutable
to reach a stable state. The ExecStateFuture is provided by the
AsyncExecHelper to allow clients to block waiting for the specified state to
be transitioned. The ExecStateFuture acts as a ManagedExecutableListener to
the ManagedExecutable such that it is aware of all the execution state
transitions on the executable. When the future is initialized, the pending state is
specified such that the future knows what state it is waiting for. In the
case of invalid state transitions the existing future will be maintained and
the returned future will be cancelled. In the case of exceptions the future
will redeem as ERROR. In the case of a pre-emptive stop during a shutdown,
both futures will redeem when the executable transitions to DONE.
Implements:
Future
ManagedExecutableListener
Links:
Kernel Association Association Link
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
package
Kernel Association Association Link
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
package
Kernel Association Association Link
Associates type:
association
Client cardinality:
1
Client navigability:
NOT NAVIGABLE
Client visibility:
private
Supplier cardinality:
1
Supplier navigability:
NAVIGABLE
Supplier visibility:
package
Implementation Implementation Link
Provides a mechanism for synchronously waiting for an ManagedExecutable
to reach a stable state. The ExecStateFuture is provided by the
AsyncExecHelper to allow clients to block waiting for the specified state to
be transitioned. The ExecStateFuture acts as a ManagedExecutableListener to
the ManagedExecutable such that it is aware of all the execution state
transitions on the executable. When the future is initialized, the pending state is
specified such that the future knows what state it is waiting for. In the
case of invalid state transitions the existing future will be maintained and
the returned future will be cancelled. In the case of exceptions the future
will redeem as ERROR. In the case of a pre-emptive stop during a shutdown,
both futures will redeem when the executable transitions to DONE.
| Field Summary |
boolean |
|
boolean |
|
CountDownLatch |
|
|
|
|
|
|
|
| Constructor Summary |
protected void |
|
| Method Summary |
public boolean |
cancel(Boolean mayInterruptIfRunning) |
public void |
|
public void |
|
|
get(Long timeout, TimeUnit unit) |
|
|
public void |
|
public boolean |
|
public boolean |
|
public void |
|
public void |
|
public void |
|
public void |
|
public void |
|
public void |
|
public void |
|
boolean isCancelled
Multiplicity:
1
boolean isDone
Multiplicity:
1
CountDownLatch latch
Multiplicity:
1
Multiplicity:
1
Multiplicity:
1
Multiplicity:
1
constructor initializes the future with its pending state
Parameters:
pendingState the state on which the future is redeemable
mgdExec the ManagedExecutable to track
Stereotype:
create
public boolean cancel (Boolean mayInterruptIfRunning)
cancel the pending future
NOTE:cancelling the future does not cancel the requested transition
it simply cancels the future and its ability to wait and notify for the
transition
Parameters:
mayInterruptIfRunning indicates if the future may be cancelled if
it is running
Return:
FALSE if the task could not be cancelled, typically because it
has already completed normally, TRUE if the task was cancelled.
indicates the specified ManagedExecutable has reached the DONE state
Parameters:
executable the ManagedExecutable whose state has changed
indicates the specified ManagedExecutable has reached the ERROR state
Parameters:
executable the ManagedExecutable whose state has changed
public ExecState get (Long timeout, TimeUnit unit)
redeems the executable state indicating that the appropriate state has
been reached or the specified timeout has been reached.
Return:
the destination state for which the future is redeemed
Throws:
InterruptedException,TimeoutException
redeems the executable state indicating that the appropriate state has
been reached
Return:
the destination state for which the future is redeemed
Throws:
InterruptedException
indicates the specified ManagedExecutable has reached the IDLE state
Parameters:
executable the ManagedExecutable whose state has changed
public boolean isCancelled ()
Return:
true if the future has been cancelled, false if the future has not been cancelled
public boolean isDone ()
Return:
true if the future has been redeemed, false if the future has not been redeemed
indicates the specified ManagedExecutable has reached the RESUMING state
Parameters:
executable the ManagedExecutable whose state has changed
indicates the specified ManagedExecutable has reached the RUNNING state
Parameters:
executable the ManagedExecutable whose state has changed
indicates the specified ManagedExecutable has reached the SHUTTINGDOWN state
Parameters:
executable the ManagedExecutable whose state has changed
indicates the specified ManagedExecutable has reached the STARTING state
Parameters:
executable the ManagedExecutable whose state has changed
indicates the specified ManagedExecutable has reached the STOPPING state
Parameters:
executable the ManagedExecutable whose state has changed
indicates the specified ManagedExecutable has reached the SUSPENDED state
Parameters:
executable the ManagedExecutable whose state has changed
indicates the specified ManagedExecutable has reached the SUSPENDING state
Parameters:
executable the ManagedExecutable whose state has changed
| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|