KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.io.Serializable JavaDoc;
15
16 /**
17  * Info on the status of a connection pool for a datastore.
18  * @keep-all
19  */

20 public class PoolStatus implements Serializable JavaDoc {
21
22     private String JavaDoc datastore;
23     private int active;
24     private int maxActive;
25     private int idle;
26     private int maxIdle;
27
28     public PoolStatus() {
29     }
30
31     public PoolStatus(String JavaDoc datastore) {
32         this.datastore = datastore;
33     }
34
35     public void fill(int maxActive, int active, int maxIdle, int idle) {
36         this.maxActive = maxActive;
37         this.active = active;
38         this.maxIdle = maxIdle;
39         this.idle = idle;
40     }
41
42     public String JavaDoc getDatastore() {
43         return datastore;
44     }
45
46     public int getActive() {
47         return active;
48     }
49
50     public int getMaxActive() {
51         return maxActive;
52     }
53
54     public String JavaDoc getActiveStr() {
55         return active + "/" + maxActive;
56     }
57
58     public int getIdle() {
59         return idle;
60     }
61
62     public int getMaxIdle() {
63         return maxIdle;
64     }
65
66     public String JavaDoc getIdleStr() {
67         return idle + "/" + maxIdle;
68     }
69
70     public String JavaDoc toString() {
71         return datastore + " active " + active + "/" + maxActive +
72             " idle " + idle + "/" + maxIdle;
73     }
74 }
75
76
Popular Tags