Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
 

com.newstep.solid.management.runtime
Class SyncManagedExecutable
All Implemented Interfaces:
       ManagedExecutable
Direct Known Subclasses:
       Node, NonSuspendableSyncExec, ProcessStatusBeacon, SampleDefaultManagedExecutable, SuspendableSyncExec

public abstract class SyncManagedExecutable      
Provides default state management for synchronous executables.
SyncManagedExecutable provides validation for the basic state transitions
and provides the notification implementation for ManagedExectuableListeners.


SyncManagedExecutable will transition the executable to the target state
state and invoke the abstract method to initiate process of transitioning
the executable to the target state.

NOTE: Synchronous executables are assumed to have achieved their target
state on return from the initiating function. As such, implementations of
SyncManagedExecutable do NOT need to indicate that they have reached their
target state. The SyncManagedExecutable will provide the appropriate
notifications when the executable returns from its overriden method.


extending SyncManagedExecutable requires implementations for the following
methods:

  • doStart(): perform executable startup

  • doStop(): perform executable stop

  • doRestart(): perform executable restart

  • doShutdown(): perform executable graceful shutdown

  • doSuspend(): perform suspension of execution

  • doResume(): perform resuming of execution


  • NOTE: If the implementation throws and exception during its
    do...() method, AsyncManagedExecutable will automatically
    transition to exectuable to ERROR and rethrow the exception.


    NOTE: the SyncManagedExecutable implementation has a default
    implementation for doSuspend, doResume and doRestart that throw an ExecutableException
    indicating that the suspend/resume/restart operation is not supported

    Abstract.
    Implements:
    ManagedExecutable
     
    Links:
    Kernel Association Association Link
    to Enumeration ExecState
    Associates type:
    association
    Client cardinality:
    1
    Client navigability:
    NOT NAVIGABLE
    Client visibility:
    private
    Supplier cardinality:
    1
    Supplier navigability:
    NAVIGABLE
    Supplier visibility:
    private
     
    Implementation Implementation Link
    to Interface ManagedExecutable
    Provides default state management for synchronous executables.
    SyncManagedExecutable provides validation for the basic state transitions
    and provides the notification implementation for ManagedExectuableListeners.


    SyncManagedExecutable will transition the executable to the target state
    state and invoke the abstract method to initiate process of transitioning
    the executable to the target state.

    NOTE: Synchronous executables are assumed to have achieved their target
    state on return from the initiating function. As such, implementations of
    SyncManagedExecutable do NOT need to indicate that they have reached their
    target state. The SyncManagedExecutable will provide the appropriate
    notifications when the executable returns from its overriden method.


    extending SyncManagedExecutable requires implementations for the following
    methods:

  • doStart(): perform executable startup

  • doStop(): perform executable stop

  • doRestart(): perform executable restart

  • doShutdown(): perform executable graceful shutdown

  • doSuspend(): perform suspension of execution

  • doResume(): perform resuming of execution


  • NOTE: If the implementation throws and exception during its
    do...() method, AsyncManagedExecutable will automatically
    transition to exectuable to ERROR and rethrow the exception.


    NOTE: the SyncManagedExecutable implementation has a default
    implementation for doSuspend, doResume and doRestart that throw an ExecutableException
    indicating that the suspend/resume/restart operation is not supported

     
     

    Field Summary
    private final static String
    private String
    private List
    private static Logger
    private ExecState
    Constructor Summary
    public void
    Method Summary
    public synchronized void
    protected void
    protected void
    protected abstract void
    protected abstract void
    protected abstract void
    protected void
    public synchronized ExecState
    public synchronized void
    public synchronized void
    private void
    public synchronized void
    public synchronized void
    public synchronized void
    public synchronized void
    Field Detail
    className
    private final static String className
    Final.
    Multiplicity:
    1
    Static.
     

    derivedName
    private String derivedName
    Multiplicity:
    1
     

    listeners
    private List listeners
    Multiplicity:
    1
     

    logger
    private static Logger logger
    Multiplicity:
    1
    Static.
     

    state
    ExecState state
     

    state
    private ExecState state
    Multiplicity:
    1
     
    Constructor Detail
    SyncManagedExecutable
    public void SyncManagedExecutable ()
     
    initialize the SyncManagedExecutable by creating it's logger, listener
    List and assigning the IDLE state
    Stereotype:
    create
     
    Method Detail
    addListener
    public synchronized void addListener (ManagedExecutableListener listener)
     
    adds the specified ManagedExecutableListener to its notification list
    Parameters:
    listener the ManagedExecutableListener to add to its notification list
    Synchronized.
     

    doRestart
    protected void doRestart ()
     
    MUST be overriden to peform executable restart
    Throws:
    ExecutableException
     

    doResume
    protected void doResume ()
     
    MUST be overriden to perform the resuming of execution
    Throws:
    ExecutableException
     

    doShutdown
    protected abstract void doShutdown ()
     
    MUST be overriden to peform the graceful shutdown of execution
    Abstract.
    Throws:
    ExecutableException
     

    doStart
    protected abstract void doStart ()
     
    MUST be overriden to perform the execution startup
    Abstract.
    Throws:
    ExecutableException
     

    doStop
    protected abstract void doStop ()
     
    MUST be overriden to peform the termination of execution
    Abstract.
    Throws:
    ExecutableException
     

    doSuspend
    protected void doSuspend ()
     
    MUST be overriden to peform the suspension of execution
    Throws:
    ExecutableException
     

    getState
    public synchronized ExecState getState ()
     
    Return:
    ExecState representing the current state of the executable
    Synchronized.
     

    removeListener
    public synchronized void removeListener (ManagedExecutableListener listener)
     
    removes the specified ManagedExectuableListener from its notification list
    Parameters:
    listener the ManagedExecutableListener to remove from the notification list
    Synchronized.
     

    resume
    public synchronized void resume ()
     
    resumes the executable and ensures that the executable can only be resumed
    from the SUSPENDED and RUNNING state.
    Synchronized.
    Throws:
    ExecutableException
     

    setState
    private void setState (ExecState state)
     
    assigns the specified state value to the executable and notifies its
    listeners.
    Parameters:
    state the ExecState to assign to the executable
     

    shutdown
    public synchronized void shutdown ()
     
    peforms a graceful shutdown on the executable and ensures that the
    executable can only be shutdown from the RUNNING and DONE states.
    Synchronized.
    Throws:
    ExecutableException
     

    start
    public synchronized void start ()
     
    starts the executable and ensures that the executable can only be started
    from the IDLE state.
    Synchronized.
    Throws:
    ExecutableException
     

    stop
    public synchronized void stop ()
     
    stops the executable and ensures that the executable can only be stopped
    from the RUNNING, SUSPENDED, SHUTTINGDOWN and DONE states.
    Synchronized.
    Throws:
    ExecutableException
     

    suspend
    public synchronized void suspend ()
     
    suspends the executable and ensures that the executable can only be suspended
    from the RUNNING and SUSPENDED states.
    Synchronized.
    Throws:
    ExecutableException
     

    Class
    Tree
              
    SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD