Class 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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      Monitor()
      Constructor.
      Monitor​(java.lang.ThreadGroup group, java.lang.String name)
      Constructor with ThreadGroup and name.
    • 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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Monitor

        public Monitor()
        Constructor.
      • Monitor

        public Monitor​(java.lang.ThreadGroup group,
                       java.lang.String name)
        Constructor with ThreadGroup and name.
    • 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 thread
        thread - 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 starting
        text - 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 stopped
        text - a text message
        e - an exception
      • allThreadsStopped

        public static boolean allThreadsStopped()
        Verifies if all threads have stopped.
        Returns:
        true if all threads in the monitor have stopped, otherwise false
      • 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 thread
        message - the new message