JACK 5.4 Application Interface

aos.jack.util.thread
Class TaskJunction

java.lang.Object
  extended byaos.jack.jak.util.Watchable
      extended byaos.jack.util.thread.TaskJunction
All Implemented Interfaces:
ObservableInt

public class TaskJunction
extends Watchable

TaskJunction is a synchronisation resource for plans and threads. It allows a monitoring plan (or thread) to wait until a group of plans have completed.


Constructor Summary
TaskJunction()
          Constructs a task Junction.
 
Method Summary
 Cursor escape()
          Returns a Cursor object that allows a joined plan to temporarily escape the TaskJunction while while waiting for a particular condition to become true.
 Cursor escape(Cursor c)
           
 int getCount()
          This returns the number of plans in the junction.
 Cursor idle()
          Returns a Cursor object to detect when the TaskJunction becomes idle.
 void join()
          Called by a plan in order to join the TaskJunction.
 void leave()
          Called by a plan in order to leave the TaskJunction.
 
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

TaskJunction

public TaskJunction()
Constructs a task Junction. A TaskJunction is idle initially.

Method Detail

join

public void join()
Called by a plan in order to join the TaskJunction.


getCount

public int getCount()
This returns the number of plans in the junction.


leave

public void leave()
Called by a plan in order to leave the TaskJunction.


idle

public Cursor idle()
Returns a Cursor object to detect when the TaskJunction becomes idle.


escape

public Cursor escape()
Returns a Cursor object that allows a joined plan to temporarily escape the TaskJunction while while waiting for a particular condition to become true. The escape() cursor should be used in a conjunction with the actual condition waited for. The returned cursor detaches from the TaskJunction when immediately when it is constructed and re-attaches itself in its finish() method. This ensures that the plan re-joins the TaskJunction during the same plan step which makes the waiting condition become true. It would look something like:


escape

public Cursor escape(Cursor c)

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