KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > klg > jprobe > profiler > api > JPHeapAPI


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: JPHeapAPI.java $ $Revision: 1.4 $ $Date: 1999/07/18 18:15:08 $ $Locker: $ KL Group Inc.
18

19 /**
20  *
21  * @version $Revision: 1.4 $
22  * @author $Author: paulj $
23  */

24
25 package com.klg.jprobe.profiler.api;
26
27 import com.klg.jprobe.api.*;
28
29 /**
30  * JPHeapAPI is the singleton factory class for Heap Analsysis. If
31  * your application is running under Profiler, getInstance() will return
32  * an instance of JPHeapAPIImpl that can be used to control profiling
33  * activity. If its not running under Profiler, a 'do nothing' instance
34  * shall be returned, relieving your code of testing this condition.
35  *
36  * @see com.klg.jprobe.api.JProbeAPI
37  * @see com.klg.jprobe.profiler.api.JPHeapAPIImpl
38  */

39 public abstract class JPHeapAPI extends JProbeAPI {
40
41 private static JPHeapAPI api_instance;
42     
43 /**
44  * Factory for creating a singleton instance of a JPPerformanceAPI.
45  * If none yet created, attempts to create one. If not able to
46  * because .dlls not present (ie. production version ) returns
47  * an instance JPHeapNopAPIImpl.
48  */

49 public static JPHeapAPI getInstance() {
50     if(api_instance == null) {
51         try {
52             api_instance = new JPHeapAPIImpl();
53         }
54         catch (UnsatisfiedLinkError JavaDoc e) {
55             api_instance = new JPHeapNopAPIImpl();
56         }
57     }
58     return api_instance;
59 }
60
61 public abstract boolean setCheckpoint();
62
63 public abstract boolean clearCheckpoint();
64
65 }
66
67
Popular Tags