|
||||||||||
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.trigger.Trigger
public class Trigger
The Trigger class is a base class for triggers (old-time EventHandlers) and implements basic common functionalilty. Triggers are also refered to as primitive EventHandlers. This is a legacy class and should not be used as a base class for development of EventHandler implementation classes. Instead the com.ibm.di.eventhandler.Switchboard class should be used.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected ScriptEngine |
bsf
|
protected RSInterface |
parent
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Trigger()
|
Method Summary | |
---|---|
void |
addEventListener(ActionListener l)
Adds a new action listener. |
void |
callFunction(String func,
Object[] param)
Using the trigger's Script Engine it calls a function with the specified name, passing to it the specified parameters |
protected void |
close()
Cleanup on termination. |
void |
declareBean(String name,
Object obj)
|
void |
dump(Object o)
Dumps the object passed using the trigger's logger. |
void |
dumpEntry(Entry e)
Dumps the Entry object passed using the trigger's logger. |
void |
execScript()
|
boolean |
fireEvent(ActionEvent e)
Triggers the action listeners using the specified action event. |
Object |
getConfig()
Returns the trigger configuration. |
EventHandlerListener |
getEventHandlerListener()
|
boolean |
getExitRequested()
Returns the value of the exit requested flag. |
Log |
getLog()
Returns the trigger's logger object. |
String |
getLogCategory()
Returns the log4j category name used by this Trigger. |
String |
getParam(String p1)
Returns the value of a connection config parameter. |
String[][] |
getParameters()
Returns the trigger's parameters. |
RSInterface |
getParent()
Returns the trigger's parent RS - this is a reference to the TDI Server in which the trigger executes. |
TaskStatistics |
getStats()
Return the statistics object |
String |
getVersion()
|
void |
includeAllScripts()
Includes all scripts from the script library marked for auto-include. |
ParserInterface |
loadParser(String name)
Creates a parser object with the specified name. |
void |
logmonitor(String msg)
|
void |
logmsg(String msg)
Logs a message to the trigger's logger using INFO log level. |
void |
logmsg(String level,
String msg)
This method logs a message with the specified level to the log. |
void |
removeEventHandlerListener()
|
void |
removeEventListener(ActionListener l)
Removes the specified action listener from the list of the action listeners. |
void |
setConfig(Object cfg)
Sets the trigger's configuration. |
void |
setEventHandlerListener(EventHandlerListener listener)
|
void |
setExitRequested(boolean value)
Sets the exit requested flag to the value specified and then interrupts the trigger. |
boolean |
setLogCategory(String categoryName)
Sets the log4j category name used when requesting a logger. |
void |
setParam(String p1,
String p2)
Sets a value to a connection config parameter. |
void |
setParameters(String[] parameter)
Sets the trigger's parameters. |
void |
setParent(RSInterface o)
Sets the trigger's parent RS - this is a reference to the TDI Server in which the trigger executes. |
void |
undeclareBean(String name)
|
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, run, 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, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.ibm.di.trigger.TriggerInterface |
---|
getName, setName, start |
Field Detail |
---|
protected RSInterface parent
protected ScriptEngine bsf
Constructor Detail |
---|
public Trigger()
Method Detail |
---|
public String[][] getParameters()
public void setParameters(String[] parameter)
public Log getLog()
getLog
in interface TriggerInterface
public void setParent(RSInterface o)
setParent
in interface TriggerInterface
o
- The new parent valuepublic RSInterface getParent()
getParent
in interface TriggerInterface
public void setConfig(Object cfg)
setConfig
in interface TriggerInterface
cfg
- The new config valuepublic void dump(Object o)
public void dumpEntry(Entry e)
public Object getConfig()
getConfig
in interface TriggerInterface
public String getParam(String p1)
public void setParam(String p1, String p2)
public TaskStatistics getStats()
getStats
in interface TriggerInterface
public ParserInterface loadParser(String name) throws Exception
Exception
public void execScript() throws Exception
Exception
public void callFunction(String func, Object[] param) throws Exception
Exception
public void declareBean(String name, Object obj) throws Exception
Exception
public void undeclareBean(String name)
public void logmsg(String level, String msg)
level
- Loglevel. Legal values are FATAL, ERROR, WARN, INFO, DEBUG.
Unrecognized keyword means DEBUG.msg
- The messagepublic void logmsg(String msg)
public void logmonitor(String msg)
public void setEventHandlerListener(EventHandlerListener listener)
setEventHandlerListener
in interface TriggerInterface
public EventHandlerListener getEventHandlerListener()
getEventHandlerListener
in interface TriggerInterface
public void removeEventHandlerListener()
removeEventHandlerListener
in interface TriggerInterface
public void addEventListener(ActionListener l)
public void removeEventListener(ActionListener l)
public boolean fireEvent(ActionEvent e)
public void includeAllScripts() throws Exception
Exception
- the underlying ScriptEngine raised an errorpublic String getLogCategory()
public boolean setLogCategory(String categoryName)
categoryName
- The logj4 category name
public boolean getExitRequested()
public void setExitRequested(boolean value)
setExitRequested
in interface TriggerInterface
value
- The new value of the exitRequestedpublic String getVersion()
getVersion
in interface VersionInfoInterface
protected void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |