01: /**********************************************************************
02: Copyright (c) 2007 Erik Bengtson and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15: Contributors:
16: ...
17: ***********************************************************************/package org.jpox.management.runtime;
18:
19: import java.util.Date;
20:
21: /**
22: * Exposes runtime statistics and operations for the StoreManager
23: */
24: public class StoreManagerRuntime implements StoreManagerRuntimeMBean {
25: long insertCount = 0;
26:
27: long deleteCount = 0;
28:
29: long updateCount = 0;
30:
31: long fetchCount = 0;
32:
33: long startTime = new Date().getTime();
34:
35: /**
36: * The StoreManager start time
37: * @return StoreManager start time
38: */
39: public long getStartTime() {
40: return startTime;
41: }
42:
43: /**
44: * The number of deletes of FCO objects in the data store
45: * @return number of deletes of FCO objects in the data store
46: */
47: public long getDeleteCount() {
48: return deleteCount;
49: }
50:
51: /**
52: * The number of inserts of FCO objects in the data store
53: * @return number of inserts of FCO objects in the data store
54: */
55: public long getFetchCount() {
56: return fetchCount;
57: }
58:
59: /**
60: * The number of inserts of FCO objects in the data store
61: * @return number of inserts of FCO objects in the data store
62: */
63: public long getInsertCount() {
64: return insertCount;
65: }
66:
67: /**
68: * The number of updates of FCO objects in the data store
69: * @return number of updates of FCO objects in the data store
70: */
71: public long getUpdateCount() {
72: return updateCount;
73: }
74:
75: public void incrementInsertCount() {
76: insertCount++;
77: }
78:
79: public void incrementDeleteCount() {
80: deleteCount++;
81: }
82:
83: public void incrementFetchCount() {
84: fetchCount++;
85: }
86:
87: public void incrementUpdateCount() {
88: updateCount++;
89: }
90: }
|