com.ibm.commerce.negotiation.commands
Class ProcessToolsControllerCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.tools.command.ToolsControllerCommandImpl
                          |
                          +--com.ibm.commerce.negotiation.commands.ProcessToolsControllerCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, ProcessToolsControllerCmd, ToolsControllerCommand

public abstract class ProcessToolsControllerCmdImpl
extends ToolsControllerCommandImpl
implements ProcessToolsControllerCmd

Process controller command. Implements common behavior for the bids processing commands.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          Copyright statement.
 
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.negotiation.commands. ProcessToolsControllerCmd
NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
ProcessToolsControllerCmdImpl()
          Default constructor.
 
Method Summary
 java.util.Hashtable getAllExceptions()
          Get a list of all the exceptions generated by this process.
protected  java.lang.String getErrorTaskName()
          Returns this command's error task name.
protected  java.lang.Class getProcessLock()
          Returns the class object for locking the current process.
protected  void handleException(java.lang.Exception e)
          Formats and saves an ECException based on the input exception value.
 boolean isReadyToCallExecute()
          Verifies that the this command is ready to be executed.
protected  void maintainMaxProcessLimit()
          Ensures that there is no more than the specified maximum number of threads running simultaneously.
protected  void registerProcess(java.lang.Thread thread, ProcessRunner runner)
          Register a new process to be monitered by the controller process.
 void reset()
          Reset current command to its initial state to allow for reuse.
 void setErrorTaskName(java.lang.String errorTaskName)
          Sets this command's error task name
 void setRequestProperties( TypedProperty requestParam)
          Saves the optional command parameter values.
protected  void waitForAll()
          Waits for all the processes controlled by this command to either complete or end abnormally.
protected  void waitForThreads(int count)
          Waits for the specified number of processes controlled by this command to either complete or end abnormally.
 
Methods inherited from class com.ibm.commerce.tools.command. ToolsControllerCommandImpl
getViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, performExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command. ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command. ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, performExecute, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
 

Field Detail
public static final java.lang.String COPYRIGHT
Copyright statement.
See Also:
Constant Field Values
Constructor Detail

ProcessToolsControllerCmdImpl

public ProcessToolsControllerCmdImpl()
Default constructor.
Method Detail

getAllExceptions

public java.util.Hashtable getAllExceptions()
Get a list of all the exceptions generated by this process.
Specified by:
getAllExceptions in interface ProcessToolsControllerCmd
Returns:
Hashtable - Exceptions table

getErrorTaskName

protected java.lang.String getErrorTaskName()
Returns this command's error task name.
Returns:
tring - Error task name

getProcessLock

protected java.lang.Class getProcessLock()
Returns the class object for locking the current process.
Returns:
Class - This class object.

handleException

protected void handleException(java.lang.Exception e)
Formats and saves an ECException based on the input exception value.
Parameters:
e - Exception - The exception instance to be formatted.

isReadyToCallExecute

public boolean isReadyToCallExecute()
Verifies that the this command is ready to be executed.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
boolean =true if command is ready, otherwise false.

maintainMaxProcessLimit

protected void maintainMaxProcessLimit()
Ensures that there is no more than the specified maximum number of threads running simultaneously.

registerProcess

protected void registerProcess(java.lang.Thread thread,
ProcessRunner runner)
Register a new process to be monitered by the controller process.
Parameters:
thread - Thread - Thread instance which starts the process
runner - ProcessRunner - The process runner which executes the command

reset

public void reset()
Reset current command to its initial state to allow for reuse.
Overrides:
reset in class AbstractECTargetableCommand

setErrorTaskName

public void setErrorTaskName(java.lang.String errorTaskName)
Sets this command's error task name
Specified by:
setErrorTaskName in interface ProcessToolsControllerCmd
Parameters:
errorTaskName - java.lang.String

setRequestProperties

public void setRequestProperties(TypedProperty requestParam)
                          throws ECApplicationException
Saves the optional command parameter values.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ToolsControllerCommandImpl
Parameters:
requestParam - request properties
Throws:
ECApplicationException: - An exception is returned if any of the mandatory parameters are missing, or invalid
ECApplicationException

waitForAll

protected void waitForAll()
Waits for all the processes controlled by this command to either complete or end abnormally.

waitForThreads

protected void waitForThreads(int count)
Waits for the specified number of processes controlled by this command to either complete or end abnormally. Process exceptions will be logged and saved for future references.
Parameters:
count - int - Number of threads to wait for.