com.sun.jdmk
Class Trace

java.lang.Object
  extended bycom.sun.jdmk.Trace
All Implemented Interfaces:
TraceTags

Deprecated. You should use TraceManager and com.sun.jdmk.trace.Trace instead.

public class Trace
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:


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

isSelected

public static boolean isSelected(int level,
                                 int type)
Deprecated. use Trace instead.

Verify whether the specified info level and the info type are selected by a listener.

It is strongly recommended to call this method before sending an information to this Trace class.

Parameters:
level - the level of trace information.
type - the type of the trace information.

parseTraceProperties

public static void parseTraceProperties()
                                 throws IOException
Deprecated. use TraceManager instead.

Parses the system properties specified at the command-line to determine the specified trace conditions.

Throws:
IOException

send

public static boolean send(int level,
                           int type,
                           String className,
                           String methodName,
                           String info)
Deprecated. use Trace instead.

Send a new information to this Trace class

Parameters:
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.
Returns:
false if the level and the type are not selected.

send

public static boolean send(int level,
                           int type,
                           String className,
                           String methodName,
                           Throwable exception)
Deprecated. use Trace instead.

Send an exception to this Trace class.

Parameters:
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.

addNotificationListener

public static void addNotificationListener(NotificationListener listener,
                                           NotificationFilter f,
                                           Object handback)
                                    throws IllegalArgumentException
Deprecated. use TraceManager instead.

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
Deprecated. use TraceManager instead.

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)
Deprecated. use TraceManager instead.

Remove a listener

Parameters:
listener - the listener to be removed.

removeAllListeners

public static void removeAllListeners()
Deprecated. use TraceManager instead.

Remove all listeners.


FCS Release
jdmk-5_1-b34.1 2005.02.10_16:46:09_MET

Copyright 1998-2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.