com.notuvy.thread
Class ThreadMonitor

java.lang.Object
  extended by com.notuvy.thread.ThreadMonitor

public class ThreadMonitor
extends Object

Allow heartbeat monitoring of a thread.

Author:
murali

Field Summary
static Collection<ThreadMonitor> ALL
           
protected static org.apache.log4j.Logger LOG
           
 
Method Summary
static List<ThreadMonitor> allMonitoredThreads()
          Return the list of all monitored threads
 long getLastHeartbeat()
           
 String getStatus()
           
 Thread getThread()
           
 TimeZone getTimeZone()
           
protected static ThreadMonitor myMonitor()
           
 void setTimeZone(TimeZone pTimeZone)
           
static String toReport()
           
 String toString()
           
static void update()
           
static void update(String pString)
           
 void updateStatus(String pStatus)
          Note that thread activity has taken place.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.log4j.Logger LOG

ALL

public static final Collection<ThreadMonitor> ALL
Method Detail

update

public static void update(String pString)

myMonitor

protected static ThreadMonitor myMonitor()

update

public static void update()

allMonitoredThreads

public static List<ThreadMonitor> allMonitoredThreads()
Return the list of all monitored threads

Returns:
A clone of the full list so that list operations are thread-safe.

toReport

public static String toReport()

getThread

public Thread getThread()

getLastHeartbeat

public long getLastHeartbeat()

getStatus

public String getStatus()

getTimeZone

public TimeZone getTimeZone()

setTimeZone

public void setTimeZone(TimeZone pTimeZone)

updateStatus

public void updateStatus(String pStatus)
Note that thread activity has taken place.

Parameters:
pStatus - The string note to describe the thread activity.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.