celeboss.command
Interface CommandEngineListener

All Known Implementing Classes:
MonitorWindow

public interface CommandEngineListener

Version:
1.0
Author:
bevans

Field Summary
static int IDLE
          State when the engine is idle.
static int PAUSED
          State when the engine is paused
static int PROCESSING
          State when the engine is processing
 
Method Summary
 void errorOccured(QueueItem item, java.lang.Exception e)
          An exception has been thrown in the execution of an item.
 void itemAdded(QueueItem item, int idx)
          A new itme has been added to the processing queue.
 void itemRemoved(QueueItem item, int idx)
          A new item has been removed from the processing queue.
 void stateChange(int state, QueueItem item)
          This method is invoked whenever the processing state of the engine chnages.
 

Field Detail

IDLE

public static final int IDLE
State when the engine is idle.

See Also:
Constant Field Values

PAUSED

public static final int PAUSED
State when the engine is paused

See Also:
Constant Field Values

PROCESSING

public static final int PROCESSING
State when the engine is processing

See Also:
Constant Field Values
Method Detail

errorOccured

public void errorOccured(QueueItem item,
                         java.lang.Exception e)
An exception has been thrown in the execution of an item. This method is invoked to notify the listener. The Item will still be requeued according to the normal rules.

Parameters:
item - Problem item.
e - Exception generated

itemAdded

public void itemAdded(QueueItem item,
                      int idx)
A new itme has been added to the processing queue. The item is positioned at the specified index.

Parameters:
item - New item.
idx - Index in the queue.

itemRemoved

public void itemRemoved(QueueItem item,
                        int idx)
A new item has been removed from the processing queue. The item is positioned at the specified index.

Parameters:
item - Old item.
idx - Index in the queue.

stateChange

public void stateChange(int state,
                        QueueItem item)
This method is invoked whenever the processing state of the engine chnages. It can be either IDLE, PAUSED or PROCESSING. For the latter state the item that is active will be passed also. The engine will also inform listeners when a new item is processed.

Parameters:
state - State of the engine.
item - Item being process or null if the engine has completed processing or paused.