|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjpl.mipl.mdms.FileService.komodo.api.RequestTerminationHandler
public abstract class RequestTerminationHandler
Purpose:
Handler that waits for invocation to begin a shutdown procedure.
Implementors must overwrite the shutdown() method with
operation shutdown logic.
If the method expectsConfirmation() returns true, then
this handler will wait until it receives a confirmation or is stopped.
Otherwise, handler will stop once shutdown procedure completes.
Copyright 2005, California Institute of Technology. ALL RIGHTS RESERVED. U.S. Government Sponsorship acknowledge. 2005.
============================================================================ Modification History : ---------------------- Date Who What ---------------------------------------------------------------------------- 08/30/2005 Nick Initial Release ============================================================================
| Field Summary | |
|---|---|
protected boolean[] |
_done
|
protected boolean[] |
_expectsConfirmation
|
protected int[] |
_state
|
static int |
STATE_ABORTED
|
static int |
STATE_INITIALIZED
|
static int |
STATE_RUNNING
|
static int |
STATE_SUCCESS
|
static int |
STATE_WAITING
|
| Constructor Summary | |
|---|---|
RequestTerminationHandler()
Constructor. |
|
RequestTerminationHandler(boolean expectsConfirmation)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
abort()
Notifies that shutdown procedure should be aborted. |
protected void |
cleanup()
Performs any initialization that might be required for handler. |
void |
confirm()
Called to signify that shutdown is complete and successful, so that the request can return. |
boolean |
expectsConfirm()
Returns true if this handler waits for external confirmation after its been invoked, but before it completes successfully. |
int |
getState()
Returns state of this handler. |
protected void |
initialize()
Performs any initialization that might be required for handler. |
boolean |
isRunning()
Convenience method that returns true if state of handler is either running or waiting. |
boolean |
isSuccessful()
Convenience method that returns true if state of handler is complete and successful. |
protected void |
postShutdown()
Performs any post shutdown logic like cleanup or status reporting. |
void |
run()
Implementation of the Runnable interface. |
protected abstract void |
shutdown()
Contains all shutdown logic for this handler. |
void |
start()
Instructs implementation to perform the necessary shutdown request to the server. |
void |
stop()
Stops the handler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int STATE_INITIALIZED
public static final int STATE_RUNNING
public static final int STATE_WAITING
public static final int STATE_SUCCESS
public static final int STATE_ABORTED
protected boolean[] _done
protected final int[] _state
protected final boolean[] _expectsConfirmation
| Constructor Detail |
|---|
public RequestTerminationHandler()
public RequestTerminationHandler(boolean expectsConfirmation)
expectsConfirmation - Flag indicating whether handler expects
to receive confirmation from external caller before exiting.| Method Detail |
|---|
public final void run()
run in interface Runnablepublic final void start()
public final void confirm()
protected final void abort()
public final void stop()
public final int getState()
public final boolean isRunning()
public final boolean isSuccessful()
public final boolean expectsConfirm()
confirm(),
abort(), stop() is called.
protected abstract void shutdown()
protected void initialize()
protected void cleanup()
protected void postShutdown()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||