|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectceleboss.command.CommandEngine
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. |
void |
addListener(CommandEngineListener listener)
Add a listener to the engine |
QueueItem |
getActiveItem()
Get the item that is active at the moment. |
java.util.List |
getQueue()
Get a read-only copy of the queue list. |
boolean |
isPaused()
Is the engine paused |
void |
removeItem(Command command,
java.lang.Object param)
Remote a queued item. |
void |
removeListener(CommandEngineListener listener)
Remove a previously registered listener to the engine |
void |
run()
Execution of the thread. |
void |
setPaused(boolean b)
Set the engine paused. |
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 |
public CommandEngine(java.lang.String name)
name - Name of engine.| Method Detail |
public void addItem(Command item,
java.lang.Object param,
int when)
item - Item to refresh.param - Parameter to pass when the command is invoked.when - How many seconds befor ethis command shoudl be invoked.public void addListener(CommandEngineListener listener)
listener - Listener to add.public QueueItem getActiveItem()
public java.util.List getQueue()
public void removeItem(Command command,
java.lang.Object param)
command - Command to removeparam - Optional parameter of the item to removepublic void removeListener(CommandEngineListener listener)
listener - Listener to remove.public void run()
run in interface java.lang.Runnablepublic void shutdown()
public boolean isPaused()
public void setPaused(boolean b)
b - New pause state.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||