/*-----------------------------------------------------------------------------
 *
 * Enhydra JdbcS
 * The Initial Developer of the Original Code is Lutris Technologies Inc.
 * Portions created by Lutris are Copyright 1997-2000 Lutris Technologies Inc.
 * All Rights Reserved.
 *
 * The contents of this file are subject to the Enhydra Public License
 * Version 1.1 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 * www.enhydra.org/license/epl.html
 *
 * Software distributed under the License is distributed on an "ASIS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 *
 * -----------------------------------------------------------------------------
 * $Id$
 * -----------------------------------------------------------------------------
 */
package org.enhydra.jdbc.pool;

/**
 * This class allows to store multiple things in the Generic 
 * Pool hashtable. In our first implementation, we store the
 * generation number. It is used to close down all pooled objects
 * that were open when a error occured, allowing new pooled objects
 * to be allocated
 */
public class GenerationObject {
    Object 	obj;		// object to store
    int 	generation;	// generation number of the object
				// generation property is managed by GenericPool object
    String	user;
    String	password;

    /**
     * constructor
     */
    public GenerationObject(Object o, int generation) {
	this.obj = o;
	this.generation = generation;
    } // constructor

    /**
     * constructor
     */
    public GenerationObject(Object o, int generation, String user, String password) {
	this.obj = o;
	this.generation = generation;
	this.user = user;
	this.password = password;
    } // constructor

    public int getGeneration() {
	return this.generation;
    } // method getGeneration

    public Object getObj() {
	return this.obj;
    } // method getObject

    public String getUser() {
	return this.user;
    } // method getUser

    public String getPassword() {
	return this.password;
    } // method getPassword

    public void killObject() {
	obj = null;
    } // method killObject

} // class GenerationObject
