/* Generated by Together */

package cobalt.deployment.descriptor.dist;

import java.util.Set;
import java.util.HashSet;

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

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

        setPassivationTimeout(-1);
        setDisconnectTimeout(-1);
        try {
        	setEngineType(ENGINE_TYPE[0]);
        } catch ( MustNotNullException e) { }
    }

    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 getEngineType() {
        return getString("engine-type");
    }

    public void setEngineType(String engineType) throws MustNotNullException {
        setString("engine-type", engineType);
    }

    public Set getNonModifyingMtds(){
        return nonModifyingMtds;
    }

    public void setNonModifyingMtds(Set nonModifyingMtds){
        this.nonModifyingMtds = nonModifyingMtds;
    }

    public void addNonModifyingMtd(MethodDescriptor mtd)
    {
		nonModifyingMtds.add(mtd);
    }

    public void removeNonModifyingMtd(MethodDescriptor mtd)
    {
        nonModifyingMtds.remove(mtd);
    }

    private Jeus30PoolConfig conPool;
    private Jeus30PoolConfig threadPool;
    private Set nonModifyingMtds;

    public static String[] ENGINE_TYPE = {
        "EXCLUSIVE_ACCESS", "SINGLE_OBJECT", "MULTIPLE_OBJECT"
    };
}
