JACK 5.4 Application Interface

aos.jack.util.cursor
Class Action

java.lang.Object
  extended byaos.jack.jak.util.Watchable
      extended byaos.jack.jak.cursor.Cursor
          extended byaos.jack.util.cursor.Change
              extended byaos.jack.util.cursor.Action
All Implemented Interfaces:
ObservableInt, java.lang.Runnable
Direct Known Subclasses:
RepeatAction

public class Action
extends Change
implements java.lang.Runnable

Action is a Cursor for invoking long-running Java methods from plans. The Action class implements the necessary logic for a Cursor that executes a durational action and captures the completion of that execution.


Field Summary
 
Fields inherited from class aos.jack.jak.cursor.Cursor
FALSE, falseCursor, TRUE, trueCursor, UNKNOWN
 
Constructor Summary
Action()
          Constructs an Action that uses the common ThreadPool for executing its durational action().
Action(java.lang.Runnable r)
          Constructs an Action that uses the common ThreadPool for executing a given Runnable.
Action(ThreadPool tp)
          Constructs an Action that uses the given ThreadPool for executing its durational action().
Action(ThreadPool tp, java.lang.Runnable r)
          Constructs an Action that uses the given ThreadPool for executing a given Runnable.
 
Method Summary
protected  void action()
          Callback for performing the durational action.
protected  boolean condition()
          Overridden to call the action method.
 void register(java.util.Observer o)
           
 void run()
           
 boolean unRegister(java.util.Observer o)
           
 
Methods inherited from class aos.jack.util.cursor.Change
finished, isTriggered, next, reset, undo
 
Methods inherited from class aos.jack.jak.cursor.Cursor
negate
 
Methods inherited from class aos.jack.jak.util.Watchable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Action

public Action()
Constructs an Action that uses the common ThreadPool for executing its durational action().


Action

public Action(ThreadPool tp)
Constructs an Action that uses the given ThreadPool for executing its durational action().

Parameters:
tp - The ThreadPool to use

Action

public Action(java.lang.Runnable r)
Constructs an Action that uses the common ThreadPool for executing a given Runnable.

Parameters:
r - The Runnable to execute.

Action

public Action(ThreadPool tp,
              java.lang.Runnable r)
Constructs an Action that uses the given ThreadPool for executing a given Runnable.

Parameters:
tp - The ThreadPool to use.
r - The Runnable to execute.
Method Detail

register

public void register(java.util.Observer o)
Overrides:
register in class Change

unRegister

public boolean unRegister(java.util.Observer o)
Overrides:
unRegister in class Change

condition

protected boolean condition()
Overridden to call the action method.

Overrides:
condition in class Change
Returns:
True if the Action has completed, false otherwise.

run

public final void run()
Specified by:
run in interface java.lang.Runnable

action

protected void action()
Callback for performing the durational action. User code extending Action should re-implement this method.


JACK 5.4 Application Interface

Copyright (C) 1999-2008, Agent Oriented Software Pty. Ltd.

US Government Restricted Rights
The JACK Modules and relevant Software Material have been developed entirely at private expense and are accordingly provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013 or subparagraph (c)(1) and (2) of the Commercial Computer Software Restricted Rights and 48 CFR 52.2270-19, as applicable.


Agent Oriented Software Pty. Ltd.     http://www.aosgrp.com
PO Box 639, Carlton South, Victoria 3053, Australia
Phone: +61 3 9349 5055, Fax: +61 3 9349 5088