KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > sessions > SessionProfiler


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2005, Oracle. All rights reserved.
22
package oracle.toplink.essentials.sessions;
23
24 import oracle.toplink.essentials.queryframework.*;
25
26 /**
27  * <p><b>Purpose</b>: This interface defines the link between the Session and the PerformanceProfiler tool.
28  * It is provide to decouple the session from tools and to allow other profilers to register with the session.
29  *
30  * @author James Sutherland
31  */

32 public interface SessionProfiler {
33     //dms sensor weight constants
34
public static final int NONE = 0;
35     public static final int NORMAL = 5;
36     public static final int HEAVY = 10;
37     public static final int ALL = Integer.MAX_VALUE;
38
39     //nouns type display name
40
public static final String JavaDoc TopLinkRootNoun = "/TopLink";
41     public static final String JavaDoc SessionNounType = "TopLink Session";
42     public static final String JavaDoc TransactionNounType = "TopLink Transaction";
43     public static final String JavaDoc QueryNounType = "Toplink Queries";
44     public static final String JavaDoc RcmNounType = "Toplink RCM";
45     public static final String JavaDoc ConnectionNounType = "TopLink Connections";
46     public static final String JavaDoc CacheNounType = "TopLink Cache";
47     public static final String JavaDoc MiscellaneousNounType = "TopLink Miscellaneous";
48
49     //dms sensors display name
50
public static final String JavaDoc SessionName = "SessionName";
51     public static final String JavaDoc LoginTime = "loginTime";
52     public static final String JavaDoc ClientSessionCreated = "ClientSession";
53     public static final String JavaDoc UowCreated = "UnitOfWork";
54     public static final String JavaDoc UowCommit = "UnitOfWorkCommits";
55     public static final String JavaDoc UowRollbacks = "UnitOfWorkRollbacks";
56     public static final String JavaDoc OptimisticLockException = "OptimisticLocks";
57     public static final String JavaDoc ReadQuery = "ReadQueries";
58     public static final String JavaDoc WriteQuery = "WriteQueries";
59     public static final String JavaDoc DeleteQuery = "DeleteQueries";
60     public static final String JavaDoc RcmStatus = "RCMStatus";
61     public static final String JavaDoc RcmReceived = "MessagesReceived";
62     public static final String JavaDoc RcmSent = "MessagesSent";
63     public static final String JavaDoc RemoteChangeSet = "RemoteChangeSets";
64     public static final String JavaDoc TlConnects = "ConnectCalls";
65     public static final String JavaDoc TlDisconnects = "DisconnectCalls";
66     public static final String JavaDoc CachedObjects = "CachedObjects";
67     public static final String JavaDoc CacheHits = "CacheHits";
68     public static final String JavaDoc CacheMisses = "CacheMisses";
69     public static final String JavaDoc ChangeSetsProcessed = "ChangesProcessed";
70     public static final String JavaDoc ChangeSetsNotProcessed = "ChangesNotProcessed";
71     public static final String JavaDoc DescriptorEvent = "DescriptorEvents";
72     public static final String JavaDoc SessionEvent = "SessionEvents";
73     public static final String JavaDoc ConnectionInUse = "ConnectionsInUse";
74     public static final String JavaDoc QueryPreparation = "QueryPreparation";
75     public static final String JavaDoc SqlGeneration = "SqlGeneration";
76     public static final String JavaDoc DatabaseExecute = "DatabaseExecute";
77     public static final String JavaDoc SqlPrepare = "SqlPrepare";
78     public static final String JavaDoc RowFetch = "RowFetch";
79     public static final String JavaDoc ObjectBuilding = "ObjectBuilding";
80     public static final String JavaDoc MergeTime = "MergeTime";
81     public static final String JavaDoc UnitOfWorkRegister = "UnitOfWorkRegister";
82     public static final String JavaDoc DistributedMergeDmsDisplayName = "DistributedMerge";
83     public static final String JavaDoc Sequencing = "Sequencing";
84     public static final String JavaDoc Caching = "Caching";
85     public static final String JavaDoc ConnectionManagement = "ConnectionManagement";
86     public static final String JavaDoc LoggingDMSDisPlayName = "Logging";
87     public static final String JavaDoc JtsBeforeCompletion = "TXBeforeCompletion";
88     public static final String JavaDoc JtsAfterCompletion = "TXAfterCompletion";
89
90     //Token used by existed default performance profiler
91
public static final String JavaDoc Register = "register";
92     public static final String JavaDoc Merge = "merge";
93     public static final String JavaDoc AssignSequence = "assign sequence";
94     public static final String JavaDoc DistributedMerge = "distributed merge";
95     public static final String JavaDoc DeletedObject = "deleted object";
96     public static final String JavaDoc Wrapping = "wrapping";
97     public static final String JavaDoc Logging = "logging";
98     public static final String JavaDoc OBJECT_BUILDING = "object building";
99     public static final String JavaDoc SQL_GENERATION = "sql generation";
100     public static final String JavaDoc QUERY_PREPARE = "query prepare";
101     public static final String JavaDoc STATEMENT_EXECUTE = "sql execute";
102     public static final String JavaDoc ROW_FETCH = "row fetch";
103     public static final String JavaDoc SQL_PREPARE = "sql prepare";
104     public static final String JavaDoc TRANSACTION = "transactions";
105     public static final String JavaDoc CONNECT = "connect";
106     public static final String JavaDoc CACHE = "cache";
107
108     /**
109      * INTERNAL:
110      * End the operation timing.
111      */

112     public void endOperationProfile(String JavaDoc operationName);
113
114     /**
115      * INTERNAL:
116      * Finish a profile operation if profiling.
117      * This assumes the start operation preceeds on the stack.
118      * The session must be passed to allow units of work etc. to share their parents profiler.
119      *
120      * @return the execution result of the query.
121      */

122     public Object JavaDoc profileExecutionOfQuery(DatabaseQuery query, oracle.toplink.essentials.internal.sessions.AbstractRecord row, oracle.toplink.essentials.internal.sessions.AbstractSession session);
123
124     /**
125      * INTERNAL:
126      * Set the sesssion.
127      */

128     public void setSession(Session session);
129
130     /**
131      * INTERNAL:
132      * Start the operation timing.
133      */

134     public void startOperationProfile(String JavaDoc operationName);
135
136     /**
137      * INTERNAL:
138      * Update the value of the State sensor.(DMS)
139      */

140     public void update(String JavaDoc operationName, Object JavaDoc value);
141
142     /**
143      * INTERNAL:
144      * Increase DMS Event sensor occurrence.(DMS)
145      */

146     public void occurred(String JavaDoc operationName);
147
148     /**
149      * INTERNAL:
150      * Set DMS sensor weight(DMS)
151      */

152     public void setProfileWeight(int weight);
153
154     /**
155      * INTERNAL:
156      * Return DMS sensor weight(DMS)
157      */

158     public int getProfileWeight();
159
160     /**
161      * INTERNAL:
162      * Initialize TopLink noun tree(DMS)
163      */

164     public void initialize();
165 }
166
Popular Tags