KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sitraka > jprobe > api > JProbeAPI


1 /*****************************************************************************
2  * Copyright (c) 1999, KL GROUP INC. All Rights Reserved.
3  * http://www.klg.com
4  *
5  * This software is the confidential and proprietary information of KL
6  * Group, Inc. ("Confidential Information"). You shall not disclose such
7  * Confidential Information and shall use it only in accordance with the
8  * terms of the license agreement you entered into with KL Group.
9  *
10  * KL GROUP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
11  * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
12  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
13  * PURPOSE, OR NON-INFRINGEMENT. KL GROUP SHALL NOT BE LIABLE FOR ANY
14  * DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
15  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
16  *****************************************************************************/

17 // RCSID -- $RCSfile: JProbeAPI.java $ $Revision: 1.1.1.2 $ $Date: 2000/10/26 19:52:04 $ $Locker: $ KL Group Inc.
18

19 /**
20  *
21  * @version $Revision: 1.1.1.2 $
22  * @author $Author: ccornu $
23  */

24
25 package com.sitraka.jprobe.api;
26
27 /**
28  * The triggers facility can provide greater control over when profiling data
29  * is collected and when snapshots are taken. However, trigger actions can
30  * only be specified for method entry and exit. By instrumenting your code
31  * using the Profiler API, an even greater level of control can be achieved.
32  *
33  * JProbeAPI is the abstract base class for all JProbe APIs. It specifies the
34  * methods that are common for each type of profiling activity, such as performance
35  * or heap analysis. Concrete implementations of this class, for performance
36  * analysis and heap analysis, are described in:
37  *
38  * @see com.klg.jprobe.profiler.api.JPPerformanceAPIImpl
39  * @see com.klg.jprobe.profiler.api.JPHeapAPIImpl
40  */

41    
42
43 public abstract class JProbeAPI {
44
45 /**
46  * Initializer for all API objects. Protected to disallow public
47  * instantiation.
48  */

49 protected JProbeAPI() {}
50
51
52 /**
53  * Pauses the collection of data.
54  * By default, data is recorded automatically when the program starts.
55  * @return false if data is not currently being recorded.
56  * @see #isRecording
57  * @see com.klg.jprobe.profiler.api.JPPerformanceAPIImpl#pauseRecording
58  * @see com.klg.jprobe.profiler.api.JPHeapAPIImpl#pauseRecording
59  */

60 public abstract boolean pauseRecording();
61
62 /**
63  * Resumes the collection of data.
64  * By default, data is recorded automatically when the program starts.
65  * @return false if data is currently being recorded.
66  * @see #isRecording
67  * @see com.klg.jprobe.profiler.api.JPPerformanceAPIImpl#resumeRecording
68  * @see com.klg.jprobe.profiler.api.JPHeapAPIImpl#resumeRecording
69  */

70 public abstract boolean resumeRecording();
71
72
73 /**
74  * Checks whether data is currently being recorded.
75  */

76 public abstract boolean isRecording();
77
78
79 /**
80  * Clears all the data recorded about
81  * the program to this point. You can use this method,
82  * for example, to ignore the data concerning the startup phase of your program.
83  * @return true if data was cleared
84  * @see com.klg.jprobe.profiler.api.JPPerformanceAPIImpl#clear
85  * @see com.klg.jprobe.profiler.api.JPHeapAPIImpl#clear
86  */

87 public abstract boolean clear();
88
89 /**
90  * Saves all the data recorded since the program started
91  * (or the last call to clear) in a snapshot file.
92  *
93  * @param snapshot_name forms the name of the snapshot file,
94  * not including the extension - dependent upon concrete implementation
95  *
96  * If the file exists, a number is appended to the name.
97  *
98  * @return true if successful
99  * @see com.klg.jprobe.profiler.api.JPPerformanceAPIImpl#clear
100  * @see com.klg.jprobe.profiler.api.JPHeapAPIImpl#clear
101  */

102 public abstract boolean save(String JavaDoc snapshot_name);
103
104
105 /**
106  * Checks whether the program is running under a JProbe product.
107  */

108 public abstract boolean isRunning();
109
110 /*
111  * Suspend execution of the application under test.
112  * If the application is not currently running under the interactive control
113  * of a Jprobe viewer, the application will not be suspended. This is
114  * intended for use when interactively analyzing an application with a viewer.
115  *
116  */

117  
118 public abstract void suspend();
119
120 }
121
Popular Tags