com.sun.jdmk
Class TraceManager

java.lang.Object
  |
  +--com.sun.jdmk.TraceManager
All Implemented Interfaces:
TraceTags

public class TraceManager
extends Object
implements TraceTags

Makes internal runtime information available through the notification mechanism.

A user can specify information types to select information. The following types are specified:

Two levels of information are specified:

This class uses notification mechanism to distribute the information. To register a listener, a TraceFilter object should be provided to do filtering. There are two ways to receive trace information:

Since:
JDMK 5.0

Field Summary
protected static String UNKOWNTYPE
           
 
Fields inherited from interface com.sun.jdmk.trace.TraceTags
INFO_ADAPTOR_CONNECTOR, INFO_ADAPTOR_HTML, INFO_ADAPTOR_SNMP, INFO_ALL, INFO_CONNECTOR_HTTP, INFO_CONNECTOR_HTTPS, INFO_CONNECTOR_RMI, INFO_DISCOVERY, INFO_HEARTBEAT, INFO_MBEANSERVER, INFO_MISC, INFO_MLET, INFO_MODELMBEAN, INFO_MONITOR, INFO_NOTIFICATION, INFO_RELATION, INFO_SNMP, INFO_TIMER, LEVEL_DEBUG, LEVEL_TRACE
 
Method Summary
static void addNotificationListener(NotificationListener listener, NotificationFilter f, Object handback)
          Add a listener with filtering conditions
static void addNotificationListener(TraceListener listener, Object handback)
          Add a listener with default filtering conditions: all types but only trace level are selected.
static void parseTraceProperties()
          Parses the system properties specified at the command-line to determine the specified trace conditions.
static void parseTraceProperties(Properties props, ClassLoader loader)
          Parses the system properties specified at the command-line to determine the specified trace conditions.
static void removeAllListeners()
          Remove all listeners.
static void removeNotificationListener(NotificationListener listener)
          Remove a listener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKOWNTYPE

protected static final String UNKOWNTYPE
See Also:
Constant Field Values
Method Detail

parseTraceProperties

public static void parseTraceProperties()
                                 throws IOException
Parses the system properties specified at the command-line to determine the specified trace conditions.

IOException

parseTraceProperties

public static void parseTraceProperties(Properties props,
                                        ClassLoader loader)
                                 throws IOException
Parses the system properties specified at the command-line to determine the specified trace conditions.

Parameters:
props - The properties file used to find trace setting. The system properties file will be used if it is null.
loader - A user specific class loader. The system class loader will be used if it is null.
IOException

addNotificationListener

public static void addNotificationListener(NotificationListener listener,
                                           NotificationFilter f,
                                           Object handback)
                                    throws IllegalArgumentException
Add a listener with filtering conditions

Parameters:
listener - the listener to be added to receive trace notification.
f - the filter used to select a trace notification. This filter should be an instance of the class TraceFilter or its sub-class. If the filter is set to null all trace information with any type and any level will be send to the listener.
handback - the object sent back to listener.
Throws:
IllegalArgumentException - Thrown if the specified filter is not an instance of the class TraceFilter or its sub-classes, or no listener is specified.

addNotificationListener

public static void addNotificationListener(TraceListener listener,
                                           Object handback)
                                    throws IllegalArgumentException
Add a listener with default filtering conditions: all types but only trace level are selected.

Parameters:
listener - the listener to be added to receive trace notification.
handback - the object will send back to listener.
Throws:
IllegalArgumentException - Thrown if the listener is null.

removeNotificationListener

public static void removeNotificationListener(NotificationListener listener)
Remove a listener

Parameters:
listener - the listener to be removed.

removeAllListeners

public static void removeAllListeners()
Remove all listeners.


JMX 1.2_8   2002.10.31_20:03:55_MET

Copyright 1999-2002 Sun Microsystems, Inc.   901 San Antonio Road Palo Alto, California, 94303, U.S.A.   All Rights Reserved.