com.knowgate.scheduler
Class WorkerThreadCallback

java.lang.Object
  extended by com.knowgate.scheduler.WorkerThreadCallback

public abstract class WorkerThreadCallback
extends java.lang.Object

Get information about what is happening inside each WorkerThread

This an abstract base class than must be inherited in order to provide the implementation for the call() method.


Field Summary
static int WT_ATOM_CONSUME
          Thread consumed an Atom.
static int WT_ATOM_GET
          Thread just got an Atom for its inmediate consumption.
static int WT_ATOMCONSUMER_NOMORE
          AtomConsumer for thread found no more pending Atoms A reference to the AtomConsumer will be in the 5th parameter of call() method
static int WT_EXCEPTION
          Thread throwed and Exception The throwed Exception will be in the 4th parameter of call() method
static int WT_JOB_FINISH
          Thread finished a Job execution A reference to the finished Job will be in the 5th parameter of call() method
static int WT_JOB_INSTANTIATE
          Thread instantiated a Job subclass A reference to the instantiated Job will be in the 5th parameter of call() method
 
Constructor Summary
WorkerThreadCallback(java.lang.String sCallbackName)
           
 
Method Summary
abstract  void call(java.lang.String sThreadId, int iOpCode, java.lang.String sMessage, java.lang.Exception oXcpt, java.lang.Object oParam)
          Provide information about thread execution milestones
 java.lang.String name()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WT_EXCEPTION

public static final int WT_EXCEPTION

Thread throwed and Exception

The throwed Exception will be in the 4th parameter of call() method

See Also:
Constant Field Values

WT_JOB_INSTANTIATE

public static final int WT_JOB_INSTANTIATE

Thread instantiated a Job subclass

A reference to the instantiated Job will be in the 5th parameter of call() method

See Also:
Constant Field Values

WT_JOB_FINISH

public static final int WT_JOB_FINISH

Thread finished a Job execution

A reference to the finished Job will be in the 5th parameter of call() method

See Also:
Constant Field Values

WT_ATOMCONSUMER_NOMORE

public static final int WT_ATOMCONSUMER_NOMORE

AtomConsumer for thread found no more pending Atoms

A reference to the AtomConsumer will be in the 5th parameter of call() method

See Also:
Constant Field Values

WT_ATOM_GET

public static final int WT_ATOM_GET

Thread just got an Atom for its inmediate consumption.

Called before Atom is consumed.

A reference to the Atom will be in the 5th parameter of call() method

See Also:
Constant Field Values

WT_ATOM_CONSUME

public static final int WT_ATOM_CONSUME

Thread consumed an Atom.

Called after Atom is consumed.

A reference to the Atom will be in the 5th parameter of call() method

See Also:
Constant Field Values
Constructor Detail

WorkerThreadCallback

public WorkerThreadCallback(java.lang.String sCallbackName)
Parameters:
sCallbackName - Each callback instance must have a unique name
Method Detail

name

public java.lang.String name()
Returns:
Callback instance name

call

public abstract void call(java.lang.String sThreadId,
                          int iOpCode,
                          java.lang.String sMessage,
                          java.lang.Exception oXcpt,
                          java.lang.Object oParam)

Provide information about thread execution milestones

Parameters:
sThreadId - String identifying the caller WorkerThread
iOpCode - Operation code (see static constants)
sMessage - Descriptive message
oXcpt - Exception thrown by WorkerThread.
This parameter is always null unless iOpCode is WT_EXCEPTION
oParam - Object related to operation.
Its class depends on the operation performed.