|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jdmk.Trace
TraceManager
and
com.sun.jdmk.trace.Trace
instead.
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 specify trace level, add -DLEVEL_TRACE or -DLEVEL_DEBUG to you command line. By default, the level is set to LEVEL_TRACE.
To specify 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 |
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)
Deprecated. use TraceManager instead. |
static void |
addNotificationListener(TraceListener listener,
Object handback)
Deprecated. use TraceManager instead. |
static boolean |
isSelected(int level,
int type)
Deprecated. use Trace instead. |
static void |
parseTraceProperties()
Deprecated. use TraceManager instead. |
static void |
removeAllListeners()
Deprecated. use TraceManager instead. |
static void |
removeNotificationListener(NotificationListener listener)
Deprecated. use TraceManager instead. |
static boolean |
send(int level,
int type,
String className,
String methodName,
String info)
Deprecated. use Trace instead. |
static boolean |
send(int level,
int type,
String className,
String methodName,
Throwable exception)
Deprecated. use Trace instead. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static boolean isSelected(int level, int type)
Trace
instead.
It is strongly recommended to call this method before sending an information to this Trace class.
level
- the level of trace information.type
- the type of the trace information.public static void parseTraceProperties() throws IOException
TraceManager
instead.
IOException
public static boolean send(int level, int type, String className, String methodName, String info)
Trace
instead.
level
- the level of trace information to be sent.type
- the type of trace information to be sent.className
- the name of the class from which the trace
information is from.methodName
- the name of the method from which the trace
information is from.info
- the trace information to be sent.
public static boolean send(int level, int type, String className, String methodName, Throwable exception)
Trace
instead.
level
- the level of trace information to be sent.type
- the type of trace information to be sent.className
- the name of the class from which the trace
information is from.methodName
- the name of the method from which the trace
information is from.exception
- exception sent as the trace information.public static void addNotificationListener(NotificationListener listener, NotificationFilter f, Object handback) throws IllegalArgumentException
TraceManager
instead.
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
TraceManager
instead.
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)
TraceManager
instead.
listener
- the listener to be removed.public static void removeAllListeners()
TraceManager
instead.
|
FCS Release jdmk-5_1-b34.1 2005.02.10_16:46:09_MET |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |