org.almendra.janet.cas.schedulers
Class CommandScheduler
java.lang.Object
org.almendra.commons.threads.ActiveObject
org.almendra.commons.threads.ActiveSchedulingObject
org.almendra.janet.cas.schedulers.AbstractScheduler
org.almendra.janet.cas.schedulers.CommandScheduler
- All Implemented Interfaces:
- java.lang.Runnable, INamedObject, ISimpleActiveObject, ILoggable
- Direct Known Subclasses:
- PriorityCommandScheduler
public abstract class CommandScheduler
- extends AbstractScheduler
- implements java.lang.Runnable, ISimpleActiveObject, INamedObject, ILoggable
Methods inherited from class org.almendra.commons.threads.ActiveSchedulingObject |
add, available, doActivity, executableAdded, executePrimary, finishedExecution, getNext, getNextPrim, getQueueSize, hasNext, isIdle, remove, resuming, startingExecution, suspending |
Methods inherited from class org.almendra.commons.threads.ActiveObject |
getName, getPriority, isActive, isVerbose, run, setActive, setName, setPriority, setVerbose, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Runnable |
run |
LOG_EVENT_PRE_EXEC_CMD
public static final java.lang.String LOG_EVENT_PRE_EXEC_CMD
- See Also:
- Constant Field Values
LOG_EVENT_POST_EXEC_CMD
public static final java.lang.String LOG_EVENT_POST_EXEC_CMD
- See Also:
- Constant Field Values
LOG_EVENT_NO_SUITABLE_INTERPRETER_FOUND
public static final java.lang.String LOG_EVENT_NO_SUITABLE_INTERPRETER_FOUND
- See Also:
- Constant Field Values
node
protected Node node
CommandScheduler
public CommandScheduler()
CommandScheduler
public CommandScheduler(Logger logger)
CommandScheduler
public CommandScheduler(int priority)
CommandScheduler
public CommandScheduler(Logger logger,
int priority)
CommandScheduler
public CommandScheduler(int priority,
boolean verbose)
CommandScheduler
public CommandScheduler(Logger logger,
int priority,
boolean verbose)
execute
protected void execute(IExecutable executable)
- Description copied from class:
ActiveSchedulingObject
- Called to process the next item from the
queue
. Must be
implemented in subclasses as appropriate.
- Specified by:
execute
in class ActiveSchedulingObject
logInterpreterNotFound
protected void logInterpreterNotFound(CommandEnvelope commandEnv)
logExecuting
protected void logExecuting(CommandEnvelope env,
java.lang.String eventName)
- Parameters:
command
- interpreter
-
getLogName
protected abstract java.lang.String getLogName()
- Returns:
execute
protected void execute(CommandEnvelope env,
IInterpreter interpreter)
monitorRemovedWaitingCommand
protected void monitorRemovedWaitingCommand(CommandEnvelope env)
- Parameters:
isEventHandlerCommand
-
monitorFinishedCommand
protected void monitorFinishedCommand(CommandEnvelope env)
- Parameters:
isEventHandlerCommand
-
monitorStartedCommand
protected void monitorStartedCommand(CommandEnvelope env)
- Parameters:
isEventHandlerCommand
-
accept
public void accept(CommandEnvelope env)
isDaemon
public boolean isDaemon()
- Description copied from class:
ActiveObject
- Implement in subclass whether thread the active object will run in when started
is a daemon thread or not. A daemon thread only lives to server user threads.
- Overrides:
isDaemon
in class AbstractScheduler
- Returns:
init
protected void init()
getInterpreter
public abstract IInterpreter getInterpreter(CommandEnvelope commandEnv)
- Parameters:
command
-
- Returns:
registeredLogEvents
public java.util.List registeredLogEvents()
- Description copied from interface:
ILoggable
- Return list of events that may occur for an object.
- Specified by:
registeredLogEvents
in interface ILoggable
- Overrides:
registeredLogEvents
in class AbstractScheduler
- Returns:
messageResuming
protected void messageResuming()
- Overrides:
messageResuming
in class AbstractScheduler
messageSuspending
protected void messageSuspending()
- Overrides:
messageSuspending
in class AbstractScheduler
setLogger
protected void setLogger(Logger logger)
- Overrides:
setLogger
in class AbstractScheduler
getApplicationName
protected abstract java.lang.String getApplicationName()
- Returns:
getCapabilityName
protected abstract java.lang.String getCapabilityName()
- Returns:
getCurrentAgentName
protected abstract java.lang.String getCurrentAgentName()
- Returns:
execute
public void execute(java.lang.Object object)
executableRemoved
protected void executableRemoved(IExecutable executable)
- Overrides:
executableRemoved
in class ActiveSchedulingObject