KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jdbc > pool > GenerationObject


1 /*
2  * XAPool: Open Source XA JDBC Pool
3  * Copyright (C) 2003 Objectweb.org
4  * Initial Developer: Lutris Technologies Inc.
5  * Contact: xapool-public@lists.debian-sf.objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  */

22 package org.enhydra.jdbc.pool;
23
24 /**
25  * This class allows to store multiple things in the Generic
26  * Pool hashtable. In our first implementation, we store the
27  * generation number. It is used to close down all pooled objects
28  * that were open when a error occured, allowing new pooled objects
29  * to be allocated
30  */

31 public class GenerationObject {
32     Object JavaDoc obj; // object to store
33
// generation number of the object
34
// generation property is managed by GenericPool object
35
int generation;
36     String JavaDoc user;
37     String JavaDoc password;
38
39     /**
40      * constructor
41      */

42     public GenerationObject(Object JavaDoc o, int generation) {
43         this.obj = o;
44         this.generation = generation;
45     }
46
47     /**
48      * constructor
49      */

50     public GenerationObject(Object JavaDoc o, int generation, String JavaDoc user, String JavaDoc password) {
51         this.obj = o;
52         this.generation = generation;
53         this.user = user;
54         this.password = password;
55     }
56
57     public int getGeneration() {
58         return this.generation;
59     }
60
61     public Object JavaDoc getObj() {
62         return this.obj;
63     }
64
65     public String JavaDoc getUser() {
66         return this.user;
67     }
68
69     public String JavaDoc getPassword() {
70         return this.password;
71     }
72
73     public void killObject() {
74         obj = null;
75     }
76
77 }
78
Popular Tags