|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jdmk.TraceManager
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:
parseTraceProperties
method of this class.
To specifiy trace level, add -DLEVEL_TRACE or -DLEVEL_DEBUG to you command line. By default, the level is set to LEVEL_TRACE.
To specifiy trace types, add the selected types to the command line as: -DINFO_MLET -DINFO_TIMER to select mlet and timer information, it is possible to add more than one type. By default, the type is set to INFO_ALL.
To specify output, add -DTRACE_OUTPUT=name_of_outfile to the command line, name_of_outfile is a file name to write message. By default, the message is written to screen.
If at least one of the three properties is specified in the command, all other which are not specified will be set to default values.
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 |
protected static final String UNKOWNTYPE
Method Detail |
public static void parseTraceProperties() throws IOException
IOException
public static void parseTraceProperties(Properties props, ClassLoader loader) throws IOException
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
public static void addNotificationListener(NotificationListener listener, NotificationFilter f, Object handback) throws IllegalArgumentException
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.
IllegalArgumentException
- Thrown if the specified filter
is not an instance of the class TraceFilter or its sub-classes,
or no listener is specified.public static void addNotificationListener(TraceListener listener, Object handback) throws IllegalArgumentException
listener
- the listener to be added to receive trace notification.handback
- the object will send back to listener.
IllegalArgumentException
- Thrown if the listener is null.public static void removeNotificationListener(NotificationListener listener)
listener
- the listener to be removed.public static void removeAllListeners()
|
JMX 1.2_8 2002.10.31_20:03:55_MET | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |