Package com.ibm.di.server
Class Monitor
- java.lang.Object
-
- java.lang.Thread
-
- com.ibm.di.server.Monitor
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
AssemblyLine
,Sequence
public class Monitor extends java.lang.Thread
This class is the base class for all IBM Tivoli Directory Integrator classes which implement executable objects, like AssemblyLines. The threadStarted(...) and threadStopped(...) methods are invoked at AssemblyLine start and stop. These two methods make sure that the Server API is notified of an AssemblyLine start/stop events, thus supporting the Server API event model.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addActionListener(java.awt.event.ActionListener l)
Sets the actionListener of the Monitor object.static void
addThread(java.lang.Integer uid, java.lang.Thread thread)
Adds a thread to the monitor.static boolean
allThreadsStopped()
Verifies if all threads have stopped.void
fireListener(java.awt.event.ActionEvent e)
Invokes the actionListener with the given event.static void
removeActionListener(java.awt.event.ActionListener l)
Removes the actionListener of the Monitor object.static void
removeThread(java.lang.Integer uid)
Removes a thread from the monitor.static java.util.Vector<AssemblyLine>
runningALs()
Returns a collection of the running AssemblyLines.static java.util.Vector<Sequence>
runningSequences()
Returns a collection of the running Sequences.void
setMonitorMessage(java.lang.Object thread, java.lang.String message)
Sets a message for the monitor.protected static void
threadStarted(java.lang.Object thread, java.lang.String text)
Adds a given thread to the collection of running threads of the monitor.protected static void
threadStopped(java.lang.Object thread, java.lang.String text, java.lang.Exception e)
Removes a given thread to the collection of running threads of the monitor.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Method Detail
-
addActionListener
public static void addActionListener(java.awt.event.ActionListener l)
Sets the actionListener of the Monitor object.- Parameters:
l
- the ActionListener to be added
-
removeActionListener
public static void removeActionListener(java.awt.event.ActionListener l)
Removes the actionListener of the Monitor object.- Parameters:
l
- the ActionListener to be added
-
fireListener
public void fireListener(java.awt.event.ActionEvent e)
Invokes the actionListener with the given event.- Parameters:
e
- the given ActionEvent object
-
addThread
public static void addThread(java.lang.Integer uid, java.lang.Thread thread)
Adds a thread to the monitor.- Parameters:
uid
- the id of the threadthread
- the thread object
-
removeThread
public static void removeThread(java.lang.Integer uid)
Removes a thread from the monitor.- Parameters:
uid
- the thread's id
-
threadStarted
protected static void threadStarted(java.lang.Object thread, java.lang.String text)
Adds a given thread to the collection of running threads of the monitor.- Parameters:
thread
- the thread that is startingtext
- a text message
-
threadStopped
protected static void threadStopped(java.lang.Object thread, java.lang.String text, java.lang.Exception e)
Removes a given thread to the collection of running threads of the monitor.- Parameters:
thread
- the thread to be stoppedtext
- a text messagee
- an exception
-
allThreadsStopped
public static boolean allThreadsStopped()
Verifies if all threads have stopped.- Returns:
true
if all threads in the monitor have stopped, otherwisefalse
-
runningALs
public static java.util.Vector<AssemblyLine> runningALs()
Returns a collection of the running AssemblyLines.- Returns:
- a collection of AssemblyLines
-
runningSequences
public static java.util.Vector<Sequence> runningSequences()
Returns a collection of the running Sequences.- Returns:
- a collection of Sequences
-
setMonitorMessage
public void setMonitorMessage(java.lang.Object thread, java.lang.String message)
Sets a message for the monitor.- Parameters:
thread
- a threadmessage
- the new message
-
-