KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > trace > TraceDestination


1 /*
2  * @(#)TraceDestination.java 1.14 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package com.sun.jmx.trace;
8
9 import java.io.IOException JavaDoc;
10
11 /**
12  * Defines the methods that a trace destination must implement.
13  *
14  * @since 1.5
15  * @since.unbundled JMX RI 1.2
16  */

17 public interface TraceDestination {
18
19     /**
20      * Verify whether the specified info level and the info type are
21      * selected by a listener.
22      *
23      * <P>It is strongly recommended to call this method before sending
24      * information to this Trace class.
25      *
26      * @param level the level of trace information.
27      * @param type the type of the trace information.
28      */

29     public boolean isSelected(int level, int type);
30
31     /**
32      * Send a new information to this Trace destination
33      *
34      * @param level the level of trace information to be sent.
35      * @param type the type of trace information to be sent.
36      * @param className the name of the class from which the trace
37      * information is from.
38      * @param methodName the name of the method from which the trace
39      * information is from.
40      * @param info the trace information to be sent.
41      * @return false if the level and the type are not selected.
42      */

43     public boolean send(int level,
44             int type,
45             String JavaDoc className,
46             String JavaDoc methodName,
47             String JavaDoc info);
48
49    /**
50      * Send an exception to this Trace class.
51      *
52      * @param level the level of trace information to be sent.
53      * @param type the type of trace information to be sent.
54      * @param className the name of the class from which the trace
55      * information is from.
56      * @param methodName the name of the method from which the trace
57      * information is from.
58      * @param exception exception sent as the trace information.
59      */

60     public boolean send(int level,
61             int type,
62             String JavaDoc className,
63             String JavaDoc methodName,
64             Throwable JavaDoc exception);
65
66     /**
67      * Reset the trace destination.
68      * The behaviour of this method is implementation dependent.
69      * It could be used, for instance, to (re)initialize the traces
70      * according to some default System properties, or to flush
71      * (empty) the log file, etc...
72      **/

73     public void reset() throws IOException JavaDoc;
74 }
75  
76
Popular Tags