celeboss.data
Class CommandEngine

java.lang.Object
  extended byceleboss.data.CommandEngine
All Implemented Interfaces:
java.lang.Runnable

public class CommandEngine
extends java.lang.Object
implements java.lang.Runnable

Create a thread class to acts as a Runnable that executes commands in the backgound. It just takes the next elements off the Queue and invokes the refresh action.


Constructor Summary
CommandEngine(java.lang.String name)
          Creates an updater for the Refreshable entities.
 
Method Summary
 void addItem(Command item, java.lang.Object param, int when)
          Adds an items to the refresh queue.
 javax.swing.table.TableModel getQueueModel()
          Get a table modle of the queued items
 void removeItem(Command command, java.lang.Object param)
          Remote a queued item.
 void run()
          Execution of the thread.
 void shutdown()
          Stop the update thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandEngine

public CommandEngine(java.lang.String name)
Creates an updater for the Refreshable entities.

Parameters:
name - Name of engine.
Method Detail

addItem

public void addItem(Command item,
                    java.lang.Object param,
                    int when)
Adds an items to the refresh queue. If this Refreshable is already queued, then the it's update time will be adjusted to be the time specified if it is sooner.

Parameters:
item - Item to refresh.
param - Parameter to pass when the command is invoked.
when - How many seconds befor ethis command shoudl be invoked.

getQueueModel

public javax.swing.table.TableModel getQueueModel()
Get a table modle of the queued items

Returns:
Modle that updates with the Queue

removeItem

public void removeItem(Command command,
                       java.lang.Object param)
Remote a queued item.

Parameters:
command - Command to remove
param - Optional parameter of the item to remove

run

public void run()
Execution of the thread.

Specified by:
run in interface java.lang.Runnable

shutdown

public void shutdown()
Stop the update thread