intarsys runtime library

de.intarsys.tools.monitor
Class AbstractMonitor

java.lang.Object
  extended by de.intarsys.tools.monitor.AbstractMonitor
All Implemented Interfaces:
IElementConfigurable, IMonitor
Direct Known Subclasses:
CompositeMonitor, Monitor

public abstract class AbstractMonitor
extends Object
implements IMonitor, IElementConfigurable

An abstract superclass to ease implementation of IMonitor objects.


Constructor Summary
AbstractMonitor()
           
AbstractMonitor(String name)
           
 
Method Summary
 ITrace attach()
          Attach this IMonitor to the current Thread.
 void configure(Element element)
           
 void detach()
          Detach this IMonitor from the current Thread.
 int getCollectAll()
           
 ITrace getCurrentTrace()
          The currently active IMonitorTrace for the running thread.
static Level getDefaultLevel()
           
 Level getLevel()
          DOCUMENT ME!
 int getLogCycle()
           
 Logger getLogger()
          The associated Logger instance.
 String getName()
          The name of this monitor.
 List getTraces()
          A list of ITrace instances.
 void reset()
          Reset all information in this monitor.
 void setCollectAll(int count)
           
static void setDefaultLevel(Level defaultLevel)
           
 void setLevel(Level traceLogLevel)
           
 void setLogCycle(int pLogCycle)
           
 void setLogger(Logger traceLog)
           
 void setName(String name)
           
 void start()
          Deprecated. use attach
 void stop()
          Deprecated. use detach
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.intarsys.tools.monitor.IMonitor
getData, getFormattedData
 

Constructor Detail

AbstractMonitor

public AbstractMonitor()

AbstractMonitor

public AbstractMonitor(String name)
Method Detail

getDefaultLevel

public static Level getDefaultLevel()

setDefaultLevel

public static void setDefaultLevel(Level defaultLevel)

attach

public final ITrace attach()
Description copied from interface: IMonitor
Attach this IMonitor to the current Thread.

Calling this method indicates the beginning of a measuring period represented by a ITrace. This method must always be paired with a call to "detach()".

Specified by:
attach in interface IMonitor
Returns:
The new IMonitorTrace.

configure

public void configure(Element element)
               throws ElementConfigurationException
Specified by:
configure in interface IElementConfigurable
Throws:
ElementConfigurationException

detach

public final void detach()
Description copied from interface: IMonitor
Detach this IMonitor from the current Thread. This call terminates the current ITrace instance.

Specified by:
detach in interface IMonitor

getCollectAll

public int getCollectAll()

getCurrentTrace

public ITrace getCurrentTrace()
The currently active IMonitorTrace for the running thread.

Specified by:
getCurrentTrace in interface IMonitor
Returns:
The currently active IMonitorTrace for the running thread.

getLevel

public Level getLevel()
DOCUMENT ME!

Returns:
Returns the traceLogLevel.

getLogCycle

public int getLogCycle()

getLogger

public Logger getLogger()
Description copied from interface: IMonitor
The associated Logger instance.

Specified by:
getLogger in interface IMonitor
Returns:
The associated Logger instance.

getName

public String getName()
Description copied from interface: IMonitor
The name of this monitor.

Specified by:
getName in interface IMonitor
Returns:
The name of this monitor.

getTraces

public List getTraces()
Description copied from interface: IMonitor
A list of ITrace instances.

This may be null if no traces are stored (see setCollectAll()).

Specified by:
getTraces in interface IMonitor
Returns:
A list of ITrace instances.

reset

public void reset()
Description copied from interface: IMonitor
Reset all information in this monitor.

Specified by:
reset in interface IMonitor

setCollectAll

public void setCollectAll(int count)

setLevel

public void setLevel(Level traceLogLevel)

setLogCycle

public void setLogCycle(int pLogCycle)

setLogger

public void setLogger(Logger traceLog)

setName

public void setName(String name)

start

@Deprecated
public void start()
Deprecated. use attach


stop

@Deprecated
public void stop()
Deprecated. use detach


intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.