/* Generated by Together */

package cobalt.deployment.descriptor.dist;

import cobalt.deployment.common.MustNotNullException;
import cobalt.deployment.descriptor.EjbDescriptor;
import cobalt.deployment.util.CommonUtil;

public class Jeus30StatefulEjbDescriptor extends Jeus30EjbDescriptor {
    public Jeus30StatefulEjbDescriptor(EjbDescriptor descriptor)
    {
        super(descriptor);
        conPool = new Jeus30PoolConfig();
        threadPool = new Jeus30PoolConfig();

        setPassivationTimeout(-1);
        setDisconnectTimeout(-1);
        try {
        	setFileDbPath(CommonUtil.getTempDir());
        } catch (MustNotNullException e) { }
        try {
        	setFileDbName(descriptor.getEjbName());
        } catch (MustNotNullException e) { }
        setMinHole(0);
        setPackingRate(0.0);
    }

    public Jeus30PoolConfig getConPool(){ return conPool; }

    public void setConPool(Jeus30PoolConfig conPool){ this.conPool = conPool; }

    public Jeus30PoolConfig getThreadPool(){ return threadPool; }

    public void setThreadPool(Jeus30PoolConfig threadPool){ this.threadPool = threadPool; }

    public int getPassivationTimeout() {
        return getInt("passivation-timeout", -1);
    }

    public String getPassivationTimeoutValue() {
        return getString("passivation-timeout");
    }

    public void setPassivationTimeout(int timeout) {
        setInt("passivation-timeout", timeout);
    }

    public int getDisconnectTimeout() {
        return getInt("disconnect-timeout", -1);
    }

    public String getDisconnectTimeoutValue() {
        return getString("disconnect-timeout");
    }

    public void setDisconnectTimeout(int timeout) {
        setInt("disconnect-timeout", timeout);
    }

    public String getFileDbPath() {
        return getString("file-db-path");
    }

    public void setFileDbPath(String fileDbPath)
    	throws MustNotNullException {
        setString("file-db-path", fileDbPath);
    }

    public String getFileDbName() {
        return getString("file-db-name");
    }

    public void setFileDbName(String fileDbName)
    	throws MustNotNullException {
        setString("file-db-name", fileDbName);
    }

    public int getMinHole() {
        return getInt("min-hole", 0);
    }

    public String getMinHoleValue() {
        return getString("min-hole");
    }

    public void setMinHole(int minHole) {
        setInt("min-hole", minHole);
    }

    public double  getPackingRate() {
        return getDouble("packing-rate", 0.0);
    }

    public String getPackingRateValue() {
        return getString ("packing-rate");
    }

    public void setPackingRate(double rate) {
        setDouble("packing-rate", rate);
    }

    private Jeus30PoolConfig conPool;
    private Jeus30PoolConfig threadPool;
}
