com.sun.jdmk
Class TraceFilter

java.lang.Object
  |
  +--com.sun.jdmk.TraceFilter
All Implemented Interfaces:
NotificationFilter, Serializable

public class TraceFilter
extends Object
implements NotificationFilter

This class is used to filter trace information. The class Trace needs an object of this class for each listener.

See Also:
Serialized Form

Field Summary
protected  int levels
           
protected  int types
           
 
Constructor Summary
TraceFilter(int levels, int types)
          Construct a TraceFilter object with the levels and types selected.
 
Method Summary
 int getLevels()
          get the levels selected
 int getTypes()
          get types selected
 boolean isNotificationEnabled(Notification notification)
          Implement the interface NotificationFilter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

levels

protected int levels

types

protected int types
Constructor Detail

TraceFilter

public TraceFilter(int levels,
                   int types)
            throws IllegalArgumentException
Construct a TraceFilter object with the levels and types selected. Here is an example to create a filter: TraceFilter myFilter = new TraceFilter(LEVEL_TRACE, INFO_MBEANSERVER | INFO_TIMER) This filter will select information from MBeanServer and Timer with the level LEVEL_TRACE.

Parameters:
levels - the selected levels of trace information.
types - the selected types of the trace information.
Throws:
IllegalArgumentException - Thrown if the specified types or levels are illegal.
Method Detail

isNotificationEnabled

public boolean isNotificationEnabled(Notification notification)
Implement the interface NotificationFilter. This implementation uses the specified types and levels to do filtering.

Specified by:
isNotificationEnabled in interface NotificationFilter
Parameters:
notification - the notification to be sent.
Returns:
true if the notification has to be sent to the listener, false otherwise.

getLevels

public int getLevels()
get the levels selected

Returns:
the levels selected for filtering.

getTypes

public int getTypes()
get types selected

Returns:
the types selected for filtering.

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.