com.sun.jdmk.trace
Class Trace

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

public final class Trace
extends Object
implements TraceTags

Sends trace to a pluggable destination.

Since:
Java DMK 5.0

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 boolean isSelected(int level, int type)
          Verify whether the specified info level and the info type are selected by a listener.
static boolean send(int level, int type, String className, String methodName, String info)
          Send a new information to this Trace class
static boolean send(int level, int type, String className, String methodName, Throwable exception)
          Send an exception to this Trace class.
static void setDestination(TraceDestination output)
          Set the trace destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setDestination

public static void setDestination(TraceDestination output)
Set the trace destination.


isSelected

public static boolean isSelected(int level,
                                 int type)
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.

send

public static boolean send(int level,
                           int type,
                           String className,
                           String methodName,
                           String info)
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)
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.

FCS Release
jdmk-5_1-b34.2 2005.11.29_16:24:00_MET

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