org.cip4.elk.impl.device.process.state
Interface DeviceState

All Known Implementing Classes:
AbstractDeviceState, IdleDeviceState, ProducingDeviceState, StoppedDeviceState, TimeDeviceState

public interface DeviceState

Represents the state of a device (State Pattern). A device usually has a worker thread that starts the execution of states. When a state has finished executing, it returns the next state that the device's worker thread should execute.

Author:
Claes Buckwalter

Method Summary
 void abort()
          Aborts this state.
 DeviceState execute(DeviceStateContext context)
          Executes this state, optionally processing a JDF node.
 org.cip4.jdflib.auto.JDFAutoDeviceInfo.EnumDeviceStatus getDeviceStatus()
          Returns the status of this device during this state.
 java.lang.String getDeviceStatusDetails()
          Returns a more detailed information about the device's status during this state.
 org.cip4.jdflib.core.JDFElement.EnumNodeStatus getNodeStatus()
           
 java.lang.String getNodeStatusDetails()
           
 boolean isExecuting()
           
 void stop()
          Stops this state.
 void suspend()
          Suspends this state.
 

Method Detail

execute

DeviceState execute(DeviceStateContext context)
Executes this state, optionally processing a JDF node. This method returns when it has finished executing, normally or because it was aborted or suspended.

Parameters:
context - the context this state is executing in

stop

void stop()
Stops this state. Stopping a state means that the job being executed is paused but is still "loaded" on the device an can be continued. When this method is called the execute(DeviceStateContext) method of this state should return with a DeviceState implementation that represents a stopped state.


suspend

void suspend()
Suspends this state. Suspending a state means that the job being executed by the state has been taken off the device, allowing another job to be execute instead. When this method is called the execute(DeviceStateContext) method of this state should return with a DeviceState implementation that represents an idle state.


abort

void abort()
Aborts this state. When this method is called the execute(DeviceStateContext) method of this state should return with a DeviceState implementation that represents an aborted state.


isExecuting

boolean isExecuting()
Returns:
true if this state is executing; false otherwise.

getDeviceStatus

org.cip4.jdflib.auto.JDFAutoDeviceInfo.EnumDeviceStatus getDeviceStatus()
Returns the status of this device during this state.

Returns:

getDeviceStatusDetails

java.lang.String getDeviceStatusDetails()
Returns a more detailed information about the device's status during this state. See Table C-1 in the JDF 1.3 Specification.

Returns:

getNodeStatus

org.cip4.jdflib.core.JDFElement.EnumNodeStatus getNodeStatus()

getNodeStatusDetails

java.lang.String getNodeStatusDetails()


Copyright © 2004-2009 CIP4. All Rights Reserved.