01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.jdo;
12:
13: import java.io.Serializable;
14:
15: /**
16: * Info on the status of a connection pool for a datastore.
17: * @keep-all
18: */
19: public class PoolStatus implements Serializable {
20:
21: private String datastore;
22: private int active;
23: private int maxActive;
24: private int idle;
25: private int maxIdle;
26:
27: public PoolStatus() {
28: }
29:
30: public PoolStatus(String datastore) {
31: this .datastore = datastore;
32: }
33:
34: public void fill(int maxActive, int active, int maxIdle, int idle) {
35: this .maxActive = maxActive;
36: this .active = active;
37: this .maxIdle = maxIdle;
38: this .idle = idle;
39: }
40:
41: public String getDatastore() {
42: return datastore;
43: }
44:
45: public int getActive() {
46: return active;
47: }
48:
49: public int getMaxActive() {
50: return maxActive;
51: }
52:
53: public String getActiveStr() {
54: return active + "/" + maxActive;
55: }
56:
57: public int getIdle() {
58: return idle;
59: }
60:
61: public int getMaxIdle() {
62: return maxIdle;
63: }
64:
65: public String getIdleStr() {
66: return idle + "/" + maxIdle;
67: }
68:
69: public String toString() {
70: return datastore + " active " + active + "/" + maxActive
71: + " idle " + idle + "/" + maxIdle;
72: }
73: }
|