|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.ibm.di.server.Monitor
com.ibm.di.server.AssemblyLine
public final class AssemblyLine
This class represents a TDI AssemblyLine. When an AssemblyLine needs to be started the com.ibm.di.server.RS object creates an instance of the AssemblyLine class and then calls the start() method on this instance. Since AssemblyLine inherits (indirectly) from java.lang.Thread this causes the run() method of the AssemblyLine to be called. An alternative method of running AssemblyLines is running them manually. This means that only a single cycle of the AssemblyLine is executed at a time, returning the work Entry result at the end of the cycle. An AssemblyLine can be run in manual mode by using the AssemblyLine constructor which is passed a com.ibm.di.server.TaskCallBlock object. This TaskCallBlock object must have had its AssemblyLine.TCB_RUNMODE_PROPNAME property set to the value of AssemblyLine.RUNMODE_MANUAL. Then a cycle can be executed by invoking the Entry executeCycle(Entry workEntry) AssemblyLine method.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static String |
OPENTRY_OPERATION
|
static String |
PROPERTIES_FILE
|
static int |
RUNMODE_I_MANUAL
|
static int |
RUNMODE_I_NORMAL
|
static int |
RUNMODE_I_PLAYBACK
|
static int |
RUNMODE_I_RECORD
|
static String |
RUNMODE_MANUAL
|
static String |
RUNMODE_NORMAL
These constants are used when passing parameters to the AL in a TCB object. |
static String |
RUNMODE_PLAYBACK
|
static String |
RUNMODE_RECORD
|
static String[] |
RUNMODES
|
static String |
TCB_CP_CHECKPOINTID
|
static String |
TCB_CP_CHECKPOINTOBJECT
|
static String |
TCB_CP_DISCARD_IWE
|
static String |
TCB_CP_FORCECLEAN
|
static String |
TCB_DEBUG_HOST
|
static String |
TCB_DEBUG_ONERROR
|
static String |
TCB_DEBUG_PORT
|
static String |
TCB_FORCE_REPLYCHANNEL
|
static String |
TCB_RUNMODE_PROPNAME
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
AssemblyLine()
Constructor for the AssemblyLine object |
|
AssemblyLine(RSInterface parent,
String taskName,
Object param,
Log log)
Constructor for the AssemblyLine object |
Method Summary | |
---|---|
void |
addRuntimeConnector(String name,
ConnectorConfig config,
boolean executeProlog)
This method creates an ALComponent from the provided connector config. |
void |
addRuntimeIterator(String name,
ConnectorInterface conn,
boolean executeProlog)
This method inserts a connector interface as an Iterator in the current AL. |
void |
bailout(Throwable error)
|
void |
debug(Object msg)
Logs a message to the AssemblyLine logfile |
void |
debugBreak(Object obj)
This method sends an object for display to the debug panel and waits for a continue/stop message. |
void |
debugBreakError(Object obj)
This method forces the debugger to stop if it runs in OnError mode. |
boolean |
debuggerEnabled()
Returns status of the debugger session |
void |
debugMsg(Object obj)
This method sends an object for display to the debug panel. |
void |
disableDebug()
DEBUG METHODS This method disconnects any open debug session. |
void |
disableDebug(Object msg)
This method sends a message to the remote UI and closes the debugger connection if it is open. |
void |
dump(Object o)
This methods dumps an object to the log file. |
void |
dumpEntry(Entry entry)
Prints the contents of an entry to the logfile. |
boolean |
enableDebug()
This method invokes enableDebug(-1, null, false); |
boolean |
enableDebug(int port)
This method invokes enableDebug(port, null, false); |
boolean |
enableDebug(int port,
String host,
boolean onerror)
This method establishes a debugging session between this AL and a remote debugger client (e.g. |
Entry |
executeCycle()
This method call executeCycle with a null initial work and processTCB set to true. |
Entry |
executeCycle(Entry workEntry)
This method call executeCycle with the provided work entry and processTCB set to true. |
Entry |
executeCycle(Entry workEntry,
boolean processTCB)
This method is called by scripts and other classes that run the assemblyline in its own context. |
void |
executeInitializeAL()
Internal method used by AssemblyLinePool. |
void |
executeMainLoop()
|
void |
executeMainLoop(int untilState)
|
void |
executeTerminateAL()
Call this method when you want to terminate the AL that was started in Cycle mode. |
void |
executeWithALPool()
Used if there is a Server Mode Connector. |
Object |
getConfig(String name)
getConfig returns a named value from the AssemblyLine's configuration. |
AssemblyLineConfig |
getConfigClone()
|
String |
getConfigStr(String name)
getConfigStr returns a named string value from the AssemblyLine's configuration. |
AssemblyLineComponent |
getConnector(String name)
Returns the AssemblyLineComponent with the given name. |
int |
getConnectorIndex(String name)
Returns a connectors index |
int |
getConnectorIndex2(String name)
Returns a connectors index |
ArrayList |
getConnectors()
Gets the connectors attribute of the AssemblyLine object |
String |
getCurrentState()
Returns the current assemblyline step position. |
int |
getCurrentStep()
|
String |
getDatabase()
Returns the database path/url where obj is recorded/played back. |
Switchboard |
getEventHandler()
|
Log |
getLog()
Gets the log attribute of the AssemblyLine object |
String |
getLogCategory()
Returns the log4j category name used by this assemblyline. |
String |
getLogFilePath()
Returns the logfile path relative to the working directory. |
String |
getNullBehavior()
Gets the nullBehavior attribute of the AssemblyLine object |
String |
getNullBehaviorValue()
Gets the nullBehaviorValue attribute of the AssemblyLine object |
String |
getNullDefinition()
Gets the nullDefinition attribute of the AssemblyLine object |
String |
getNullDefinitionValue()
Gets the nullDefinitionValue attribute of the AssemblyLine object |
Entry |
getOpEntry()
Returns the operational entry |
Object |
getParam(String name)
getParam returns the value for a user-defined parameter. |
RSInterface |
getParent()
This method returns the RSInterface (main) object. |
String |
getPerfStats(String component)
|
boolean |
getResetCheckpoint()
Returns whether this assemblyline will force a clear of it's checkpoint store. |
Entry |
getResult()
This method returns the result entry object. |
int |
getRunMode()
Returns the runMode for the AL. |
ScriptEngine |
getScriptEngine()
getScriptEngine returns the ScriptEngine object for the AssemblyLine. |
String |
getShortName()
This method returns the short name of this AL. |
TaskStatistics |
getStats()
This method returns the TaskStatistics object for this AssemblyLine. |
boolean |
getTerminationRequested()
Returns the status of termination requested flag |
String |
getTombstoneUserMessage()
|
Entry |
getUserCheckpoint()
This method returns the user entry from the checkpoint store. |
Entry |
getWork()
This method returns the initial work entry object. |
int |
hashCode()
|
boolean |
hasServerModeConnector()
Checks if this assemblyline contains an enabled server mode connector. |
void |
initExecuteProlog()
This method is automatically called for AssemblyLines running in manual mode by the startAL() method. |
void |
initScriptEngine()
This method creates the script engine instance. |
boolean |
isPlaying()
Returns true if runMode == 2. |
boolean |
isPlaying(Object obj)
Returns true if the object obj should be played back from server store. |
boolean |
isRecording()
Returns true if runMode == 1. |
boolean |
isRecording(Object obj)
Returns true if the object obj should be recorded. |
boolean |
isRestarting()
Returns true if the AssemblyLine is in the process of restarting. |
AssemblyLineComponent |
loadConnector(BaseConfiguration config)
This method enables the user to load an AssemblyLine component given a configuration. |
void |
logmonitor(String msg)
Logs a message to the monitor. |
void |
logmsg(Object msg)
Logs a message to the AssemblyLine logfile |
void |
logmsg(String level,
String msg)
This method logs a message with the specified level to the AssemblyLine log. |
void |
logPerfStats()
Dumps a formatted message to the logfile the contents of a performance entry. |
void |
removeRuntimeConnector(String name)
This methods removes a runtime connector from the AL. |
void |
resetIterators()
|
void |
run()
The run method kicks off the thread and starts AssemblyLine execution. |
void |
saveParams()
This method saves the current AL params to the file configured in the AL settings |
void |
setConfig(String name,
Object value)
setConfig sets a named parameter value in the AssemblyLine's configuration. |
void |
setIgnoreInputComponents(boolean value)
|
boolean |
setLogCategory(String categoryName)
Sets the log4j category name used when requesting a logger. |
boolean |
setNextConnector(AssemblyLineComponent alc)
Sets the next connector to execute. |
boolean |
setNextConnector(AssemblyLineComponent alc,
boolean continueAfter)
|
void |
setParam(String name,
Object value)
setParam sets the value for the user-defined parameter. |
void |
setPerfEnabled()
|
void |
setResetCheckpoint(boolean resetCheckpointStore)
Sets the reset-checkpoint flag. |
void |
setTombstoneUserMessage(String aUserMessage)
|
Exception |
setUserCheckpoint(Entry cp)
This method writes the user entry to the checkpoint store. |
void |
setWork(Entry entry)
This method sets the initial work entry object. |
void |
shutdown()
Request controlled shutdown of assemblyline |
void |
startPerfRecording(String component)
Starts Performance Recording |
String |
stopPerfRecording(String component)
Stops Performance Recording |
void |
terminate()
Closes the connector and releases resources. |
boolean |
wasRestarted()
Returns true if the AssemblyLine was restarted. |
Methods inherited from class com.ibm.di.server.Monitor |
---|
addActionListener, addThread, allThreadsStopped, fireListener, removeActionListener, removeThread, runningALs, runningEHs, setMonitorMessage, threadStarted, threadStopped |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String RUNMODE_NORMAL
public static final String RUNMODE_RECORD
public static final String RUNMODE_PLAYBACK
public static final String RUNMODE_MANUAL
public static final String[] RUNMODES
public static final int RUNMODE_I_NORMAL
public static final int RUNMODE_I_RECORD
public static final int RUNMODE_I_PLAYBACK
public static final int RUNMODE_I_MANUAL
public static final String TCB_RUNMODE_PROPNAME
public static final String TCB_CP_FORCECLEAN
public static final String TCB_CP_CHECKPOINTID
public static final String TCB_CP_CHECKPOINTOBJECT
public static final String TCB_CP_DISCARD_IWE
public static final String TCB_FORCE_REPLYCHANNEL
public static final String OPENTRY_OPERATION
public static final String TCB_DEBUG_PORT
public static final String TCB_DEBUG_HOST
public static final String TCB_DEBUG_ONERROR
public static final String PROPERTIES_FILE
Constructor Detail |
---|
public AssemblyLine()
public AssemblyLine(RSInterface parent, String taskName, Object param, Log log) throws Exception
parent
- RSInterface of caller/creatortaskName
- Name of assemblyline to runparam
- Optional parameter(s)log
- Optional Log object for logging
Exception
- Thrown if taskName is an unknown assemblyline or if any of the connectors cannot be initializedMethod Detail |
---|
public int hashCode()
hashCode
in class Object
public void setWork(Entry entry)
entry
- The initial work entrypublic void setParam(String name, Object value)
name
- The user-defined parameter namevalue
- The value associated with namepublic void setConfig(String name, Object value)
name
- The AssemblyLine configuration parameter namevalue
- The value associated with namepublic RSInterface getParent()
getParent
in interface TaskInterface
public Entry getResult()
getResult
in interface TaskInterface
public Entry getWork()
getWork
in interface TaskInterface
public String getLogFilePath()
public Object getParam(String name)
name
- The user-defined parameter name
public Object getConfig(String name)
getConfig
in interface TaskInterface
name
- The AssemblyLine parameter name
public String getConfigStr(String name)
name
- The AssemblyLine parameter name
getConfig(java.lang.String)
public ScriptEngine getScriptEngine()
getScriptEngine
in interface TaskInterface
public TaskStatistics getStats()
public AssemblyLineComponent getConnector(String name)
getConnector
in interface TaskInterface
name
- The connector name as specified in the configuration
public int getConnectorIndex(String name) throws Exception
name
- The connector name as specified in the configuration
Exception
public ArrayList getConnectors()
public Log getLog()
getLog
in interface TaskInterface
public String getNullBehavior()
getNullBehavior
in interface TaskInterface
public String getNullBehaviorValue()
getNullBehaviorValue
in interface TaskInterface
public String getNullDefinition()
getNullDefinition
in interface TaskInterface
public String getNullDefinitionValue()
getNullDefinitionValue
in interface TaskInterface
public void run()
run
in interface Runnable
run
in class Thread
public boolean hasServerModeConnector()
public void terminate() throws Exception
Exception
public void addRuntimeIterator(String name, ConnectorInterface conn, boolean executeProlog) throws Exception
Exception
public void addRuntimeConnector(String name, ConnectorConfig config, boolean executeProlog) throws Exception
Exception
public void removeRuntimeConnector(String name) throws Exception
Exception
public AssemblyLineComponent loadConnector(BaseConfiguration config) throws Exception
config
- The component configuration (e.g. ConnectorConfig,
FunctionConfig etc).
Exception
public void logmsg(Object msg)
logmsg
in interface TaskInterface
msg
- The messagepublic void logmsg(String level, String msg)
level
- Loglevel. Legal values are FATAL, ERROR, WARN, INFO, DEBUG.
Unrecognized keyword means DEBUG.msg
- The messagepublic void debug(Object msg)
msg
- The messagepublic void logmonitor(String msg)
msg
- The messagepublic void dump(Object o)
o
- The object to dumppublic void dumpEntry(Entry entry)
entry
- The entry object to printpublic void disableDebug()
public void disableDebug(Object msg)
msg
- Message to be sentpublic boolean enableDebug()
public boolean enableDebug(int port)
port
- The TCP port number of the remote debugger client
public boolean enableDebug(int port, String host, boolean onerror)
port
- The TCP port number of the remote debugger client
public boolean debuggerEnabled()
public void debugMsg(Object obj) throws Exception
debugMsg
in interface TaskInterface
obj
- The object to display. This object must be Serializable
Exception
- Serialization exceptionpublic void debugBreak(Object obj) throws Exception
debugBreak
in interface TaskInterface
obj
- The object to display
Exception
- Serialization exceptionpublic void debugBreakError(Object obj) throws Exception
obj
- The error
Exception
- Serialization exceptionpublic void initScriptEngine() throws Exception
Exception
- Script engine exceptionspublic void saveParams()
public boolean wasRestarted()
public boolean isRestarting()
public void shutdown()
public boolean getTerminationRequested()
public String getLogCategory()
public boolean setLogCategory(String categoryName)
categoryName
- The logj4 category name
public void executeInitializeAL()
public void executeMainLoop()
public void executeMainLoop(int untilState)
public void executeTerminateAL() throws Exception
Exception
public void resetIterators() throws Throwable
Throwable
public void initExecuteProlog() throws Exception
Exception
public Entry executeCycle() throws Throwable
Throwable
public Entry executeCycle(Entry workEntry) throws Throwable
Throwable
public Entry executeCycle(Entry workEntry, boolean processTCB) throws Throwable
workEntry
- The work entry to use, or null to use an empty work entry/iterator entryprocessTCB
- If true, the AL's call/return attribute maps are applied to the provided entry and returned entry
Exception
- when method is called and AL was not started in "Cycle" mode or this method is
called after having returned a null entry (e.g. end of iteration)
Throwable
public String getCurrentState()
public void bailout(Throwable error)
public int getConnectorIndex2(String name) throws Exception
name
- The connector name as specified in the configuration
Exception
public Entry getUserCheckpoint() throws Exception
Exception
public Exception setUserCheckpoint(Entry cp) throws Exception
Exception
public int getRunMode()
public boolean getResetCheckpoint()
public void setResetCheckpoint(boolean resetCheckpointStore)
public boolean isRecording()
public boolean isPlaying()
public boolean isRecording(Object obj)
isRecording
in interface RecordPlaybackInterface
public boolean isPlaying(Object obj)
isPlaying
in interface RecordPlaybackInterface
public String getDatabase()
getDatabase
in interface RecordPlaybackInterface
public String getShortName()
public void executeWithALPool()
public Switchboard getEventHandler()
public void setIgnoreInputComponents(boolean value)
public int getCurrentStep()
public boolean setNextConnector(AssemblyLineComponent alc) throws Exception
alc
- The connector to execute
Exception
public boolean setNextConnector(AssemblyLineComponent alc, boolean continueAfter) throws Exception
Exception
public AssemblyLineConfig getConfigClone() throws Exception
Exception
public void setTombstoneUserMessage(String aUserMessage)
public String getTombstoneUserMessage()
public Entry getOpEntry()
public void startPerfRecording(String component)
component
- Unique ComponentIDpublic String stopPerfRecording(String component)
component
- Unique ComponentIDpublic String getPerfStats(String component)
public void logPerfStats()
dump(java.lang.Object)
public void setPerfEnabled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |