com.sentilla.platform.cmote
Class DispatcherAction

java.lang.Object
  extended by com.sentilla.platform.cmote.DispatcherAction
All Implemented Interfaces:
Action
Direct Known Subclasses:
Receiver, Sender

public abstract class DispatcherAction
extends Object
implements Action

Provides the Action implementations for Sender and Receiver.

This abstract class should only be extended by Sender and Receiver.

See Also:
Action, Sender, Receiver, Dispatcher

Field Summary
protected  byte actionState
           
 
Fields inherited from interface com.sentilla.system.Action
DONE, ERROR, IDLE, PENDING
 
Constructor Summary
DispatcherAction()
           
 
Method Summary
 Action block()
          Blocks until an interrupt is received.
 Action block(int timeoutMilli)
          Block for "timeoutMilli" milliseconds.
 Action cancel()
          Cancels the current action (unsupported).
 byte getActionState()
          Returns the current action state.
 boolean isDone()
          Checks if the current action state is Action.DONE.
protected  boolean subcancel()
          Called during cancel().
 Action submit()
          Submits this for processing, returns true if succeeded.
protected abstract  boolean subsubmit()
          Called during submit().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actionState

protected byte actionState
Constructor Detail

DispatcherAction

public DispatcherAction()
Method Detail

submit

public Action submit()
Submits this for processing, returns true if succeeded. Used by the Sender and Receiver to implement the system Action interface. Classes deriving from DispatcherAction must implement the subsubmit() method.

Specified by:
submit in interface Action
Returns:
the DispatcherAction object.
See Also:
Action

block

public Action block()
Blocks until an interrupt is received.

Specified by:
block in interface Action
Returns:
the DispatcherAction object
See Also:
Action

block

public Action block(int timeoutMilli)
Block for "timeoutMilli" milliseconds. Similar to Thread.wait(int), causes the action to wait until either "timeoutMilli" milliseconds has elapsed, or an interrupt is received.

Specified by:
block in interface Action
Parameters:
timeoutMilli - number of milliseconds to block
Returns:
the DispatcherAction object
See Also:
Action

cancel

public Action cancel()
Cancels the current action (unsupported). Currently this is unsupported for any PENDING action. Required by Action interface.

Specified by:
cancel in interface Action
Returns:
the DispatcherAction object
See Also:
Action

getActionState

public byte getActionState()
Returns the current action state.

Specified by:
getActionState in interface Action
Returns:
the current Action state.
See Also:
Action

isDone

public boolean isDone()
Checks if the current action state is Action.DONE. Returns true if the action is done.

Specified by:
isDone in interface Action
Returns:
boolean value of true or false, true=pending, false=error
See Also:
Action

subsubmit

protected abstract boolean subsubmit()
Called during submit(). Action performed during submit.

Returns:
boolean true or false

subcancel

protected boolean subcancel()
Called during cancel(). Action performed during cancel.

Returns:
false by default.


Copyright © 2007 Sentilla Corporation. All Rights Reserved.