KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdo > ServerLogEvent


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.jdo;
13
14 import com.versant.core.logging.LogEvent;
15 import com.versant.core.logging.LogEvent;
16
17 /**
18  * Server side performance events.
19  */

20 public class ServerLogEvent extends LogEvent {
21
22     protected int type;
23     protected String JavaDoc description;
24
25     public static final int JDOQL_COMPILE = 1;
26     public static final int JDOQL_EXEC = 2;
27     public static final int JDOQL_EXEC_COUNT = 33;
28     public static final int SET_PROPERTY = 3;
29     public static final int REMOTE_PMF_CONNECT = 4;
30     public static final int REMOTE_PMF_DISCONNECT = 5;
31     public static final int REMOTE_PMF_BAD_AUTH = 6;
32     public static final int REMOTE_PMF_DISABLED = 7;
33     public static final int REMOTE_PMF_BAD_VERSION = 8;
34     public static final int REMOTE_PM_DISABLED = 12;
35     public static final int PM_CREATED = 13;
36     public static final int PM_CLOSED = 14;
37     public static final int PM_CLOSED_AUTO = 15;
38     public static final int PM_CLOSED_AUTO_TX = 16;
39     public static final int TX_BEGIN = 17;
40     public static final int TX_BEGIN_DATASTORE = 18;
41     public static final int TX_COMMIT = 19;
42     public static final int TX_ROLLBACK = 20;
43     public static final int TX_FLUSH_AUTO = 21;
44     public static final int TX_FLUSH = 22;
45     public static final int PMF_EVICT = 23;
46     public static final int PMF_EVICT_ALL = 24;
47     public static final int PMF_EVICT_CLASS = 25;
48     public static final int PM_ALLOC = 26;
49     public static final int PM_RELEASE = 27;
50     public static final int LOCK_CLEANUP = 28;
51     public static final int JDOQL_CACHE_HIT = 29;
52     public static final int JDOQL_CACHE_EVICT = 30;
53     public static final int JDOQL_CACHE_FAIL = 31;
54     public static final int SET_DATASTORE_TX_LOCKING = 32;
55     public static final int GET_STATE = 34;
56     public static final int GET_STATE_MULTI = 35;
57     public static final int GET_QUERY_BATCH = 36;
58     public static final int GET_QUERY_ALL = 37;
59     public static final int USER = 38;
60     public static final int SET_RETAIN_CONNECTION_IN_OPT_TX = 39;
61
62     public ServerLogEvent(int type, String JavaDoc description) {
63         this.type = type;
64         this.description = description;
65     }
66
67     /**
68      * Get a short descriptive name for this event.
69      */

70     public String JavaDoc getName() {
71         switch (type) {
72             case JDOQL_COMPILE: return "jdoql.compile";
73             case JDOQL_EXEC: return "jdoql.exec";
74             case JDOQL_EXEC_COUNT: return "jdoql.exec.count";
75             case JDOQL_CACHE_HIT: return "jdoql.cache.hit";
76             case JDOQL_CACHE_EVICT: return "jdoql.cache.evict";
77             case JDOQL_CACHE_FAIL: return "jdoql.cache.fail";
78             case GET_STATE: return "get.state";
79             case GET_STATE_MULTI: return "get.state.multi";
80             case GET_QUERY_BATCH: return "get.query.batch";
81             case GET_QUERY_ALL: return "get.query.all";
82             case PMF_EVICT: return "pmf.evict";
83             case PMF_EVICT_ALL: return "pmf.evict.all";
84             case PMF_EVICT_CLASS: return "pmf.evict.class";
85             case REMOTE_PMF_CONNECT: return "remote.pmf.connect";
86             case REMOTE_PMF_DISCONNECT: return "remote.pmf.disconnect";
87             case REMOTE_PMF_BAD_AUTH: return "remote.pmf.badauth";
88             case REMOTE_PMF_DISABLED: return "remote.pmf.disabled";
89             case REMOTE_PMF_BAD_VERSION: return "remote.pmf.bad.version";
90             case REMOTE_PM_DISABLED: return "remote.pm.disabled";
91             case PM_CREATED: return "pm.created";
92             case PM_CLOSED: return "pm.closed";
93             case PM_CLOSED_AUTO: return "pm.closed.auto";
94             case PM_CLOSED_AUTO_TX: return "pm.closed.auto.tx";
95             case PM_ALLOC: return "pm.alloc";
96             case PM_RELEASE: return "pm.release";
97             case SET_DATASTORE_TX_LOCKING: return "set.ds.tx.locking";
98             case SET_RETAIN_CONNECTION_IN_OPT_TX: return "set.retain.con.in.opt.tx";
99             case TX_BEGIN: return "tx.begin";
100             case TX_BEGIN_DATASTORE: return "tx.begin.datastore";
101             case TX_COMMIT: return "tx.commit";
102             case TX_ROLLBACK: return "tx.rollback";
103             case TX_FLUSH_AUTO: return "tx.flush.auto";
104             case TX_FLUSH: return "tx.flush";
105             case LOCK_CLEANUP: return "lock.cleanup";
106             case SET_PROPERTY: return "set.property";
107             case USER: return "user";
108         }
109         return "UNKNOWN(" + type + ")";
110     }
111
112     /**
113      * Get a long description for this event (e.g. the query text).
114      */

115     public String JavaDoc getDescription() {
116         return description;
117     }
118
119     public void setDescription(String JavaDoc description) {
120         this.description = description;
121     }
122
123 }
124
Popular Tags