FileDocCategorySizeDatePackage
JdbcConnectionPool.javaAPI DocGlassfish v2 API14621Fri May 04 22:34:56 BST 2007com.sun.enterprise.tools.common.deploy

JdbcConnectionPool

public class JdbcConnectionPool extends Object implements Serializable

Fields Summary
private String
name
private String
id
private String
JdbcFactoryClassName
private String
ResType
private String
MinConnectionsInPool
private String
MaxConnectionsInPool
private String
MaxConnectionWaitTimeInMillis
private String
ConnectionsIncrement
private String
ConnectionIdleTimeoutInSeconds
private String
IsConnectionValidationRequired
private String
ConnectionValidationType
private String
ValidationTableName
private String
FailAllConnections
private String
XIsolationLevel
private String
IsIsolationLevelGuaranteed
private NameValuePair[]
extParams
private transient PropertyChangeSupport
propertySupport
Constructors Summary
public JdbcConnectionPool(List resource)

        propertySupport = new PropertyChangeSupport ( this );
        
            id = "PoolName";  //NOI18N
            JdbcFactoryClassName = "DatasourceClassName";//NOI18N
            ResType = "javax.sql.DataSource";  //NOI18N
/*          DatabaseURL = "jdbc:";//NOI18N
            UserName = "UserName";//NOI18N
            Password = "Password";//NOI18N          
*/          MinConnectionsInPool = "8"; // NOI18N
//	    InitialConnectionsInPool = "2";
	    MaxConnectionsInPool = "32";  //NOI18N
	    MaxConnectionWaitTimeInMillis = "60000";  //NOI18N
	    ConnectionsIncrement = "2";  //NOI18N
	    ConnectionIdleTimeoutInSeconds = "300";  //NOI18N
	    IsConnectionValidationRequired = "false";  //NOI18N
	    ConnectionValidationType = "auto-commit";  //NOI18N
	    ValidationTableName = "TAB_NAME";  //NOI18N
	    FailAllConnections = "false";	  //NOI18N
            XIsolationLevel = "";   //NOI18N
            IsIsolationLevelGuaranteed = "true";  //NOI18N
            extParams = new NameValuePair[0];       

        //List cp = com.iplanet.ias.tools.forte.globalsettings.IasGlobalOptionsSettings.DEFAULT.getJdbcConnectionPoolList();
        String t_name = null;
        if(resource.size() != 0){
           int num = resource.size()+1; 
           t_name = "JdbcConnectionPool_" + num;//NOI18N
           boolean exists = FactoryName(t_name, resource);
           while(exists){
             num++;
             t_name = "JdbcConnectionPool_" + num;//NOI18N
             exists = FactoryName(t_name, resource);
           }
        } else {
           t_name = "JdbcConnectionPool_1";//NOI18N
        }
        name = t_name;
        id = t_name;
    
Methods Summary
public booleanFactoryName(java.lang.String value, java.util.List resources)

      boolean exists = false;  
      //List pm1 = com.iplanet.ias.tools.forte.globalsettings.IasGlobalOptionsSettings.DEFAULT.getPMFactoryInsts();
      for(int i=0; i<resources.size(); i++){
        IJdbcConnectionPool instance = (IJdbcConnectionPool) resources.get(i);
        String inst = instance.getName();
        if(inst.equals(value))
           exists = true;
      }//for
      return exists;
    
public voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)

        initPropertyChangeSupport();
        propertySupport.addPropertyChangeListener (listener);
    
public java.lang.StringgetConnectionIdleTimeoutInSeconds()

	return ConnectionIdleTimeoutInSeconds;
    
public java.lang.StringgetConnectionValidationType()

	return ConnectionValidationType;
    
public java.lang.StringgetConnectionsIncrement()

	return ConnectionsIncrement;
    
public NameValuePair[]getExtParams()

        return extParams;
    
public java.lang.StringgetFailAllConnections()

	return FailAllConnections;
    
public java.lang.StringgetId()

        return id;
    
public java.lang.StringgetIsConnectionValidationRequired()

	return IsConnectionValidationRequired;
    
public java.lang.StringgetIsIsolationLevelGuaranteed()

        return IsIsolationLevelGuaranteed;
    
public java.lang.StringgetJdbcFactoryClassName()

        return JdbcFactoryClassName;
    
public java.lang.StringgetMaxConnectionWaitTimeInMillis()

	return MaxConnectionWaitTimeInMillis;
    
public java.lang.StringgetMaxConnectionsInPool()

    	return MaxConnectionsInPool;
    
public java.lang.StringgetMinConnectionsInPool()

	return MinConnectionsInPool;
    
public java.lang.StringgetName()

        return name;
    
public java.lang.StringgetResType()

        return ResType;
    
public java.lang.StringgetValidationTableName()

	return ValidationTableName;
    
public java.lang.StringgetXIsolationLevel()

        return XIsolationLevel;
    
private voidinitPropertyChangeSupport()

        if(propertySupport==null)
            propertySupport = new PropertyChangeSupport ( this );

    
public voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)

        initPropertyChangeSupport();
        propertySupport.removePropertyChangeListener (listener);
    
public voidsetConnectionIdleTimeoutInSeconds(java.lang.String value)

        String oldValue = ConnectionIdleTimeoutInSeconds;
        this.ConnectionIdleTimeoutInSeconds = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("ConnectionIdleTimeoutInSeconds", oldValue, ConnectionIdleTimeoutInSeconds);//NOI18N        
    
public voidsetConnectionValidationType(java.lang.String value)

        String oldValue = ConnectionValidationType;
        this.ConnectionValidationType = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("ConnectionValidationType", oldValue, ConnectionValidationType);//NOI18N         
    
public voidsetConnectionsIncrement(java.lang.String value)

        String oldValue = ConnectionsIncrement;
        this.ConnectionsIncrement = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("ConnectionsIncrement", oldValue, ConnectionsIncrement);//NOI18N                
    
public voidsetExtParams(java.lang.Object[] value)

        Reporter.info(new Integer(value.length)); //NOI18N
        NameValuePair[] pairs = new NameValuePair[value.length];
        for (int i = 0; i < value.length; i++) {
            NameValuePair val = (NameValuePair)value[i];
            NameValuePair pair = new NameValuePair();
            pair.setParamName(val.getParamName());
            pair.setParamValue(val.getParamValue());
            pair.setParamDescription(val.getParamDescription());
            Reporter.info(pair.getParamName() + "   " + pair.getParamValue()); //NOI18N
            pairs[i] = pair;
        }
        NameValuePair[] oldValue = extParams;
        this.extParams = pairs;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("extParams", oldValue, extParams);//NOI18N
    
public voidsetFailAllConnections(java.lang.String value)

        String oldValue = FailAllConnections;
        this.FailAllConnections = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("FailAllConnections", oldValue, FailAllConnections);//NOI18N        
    
public voidsetId(java.lang.String value)

        String oldValue = id;
        this.id = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("id", oldValue, id);//NOI18N
        setName(id);
    
public voidsetIsConnectionValidationRequired(java.lang.String value)

        String oldValue = IsConnectionValidationRequired;
        this.IsConnectionValidationRequired = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("IsConnectionValidationRequired", oldValue, IsConnectionValidationRequired);//NOI18N                
    
public voidsetIsIsolationLevelGuaranteed(java.lang.String val)

        String prev = this.IsIsolationLevelGuaranteed;
        this.IsIsolationLevelGuaranteed = val;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("IsIsolationLevelGuaranteed", prev, IsIsolationLevelGuaranteed);//NOI18N
    
public voidsetJdbcFactoryClassName(java.lang.String facname)

        String prev = JdbcFactoryClassName;
        this.JdbcFactoryClassName = facname;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("JdbcFactoryClassName", prev, JdbcFactoryClassName);//NOI18N
    
public voidsetMaxConnectionWaitTimeInMillis(java.lang.String value)

        String oldValue = MaxConnectionWaitTimeInMillis;
        this.MaxConnectionWaitTimeInMillis = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("MaxConnectionWaitTimeInMillis", oldValue, MaxConnectionWaitTimeInMillis);//NOI18N         
    
public voidsetMaxConnectionsInPool(java.lang.String value)

        String oldValue = MaxConnectionsInPool;
        this.MaxConnectionsInPool = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("MaxConnectionsInPool", oldValue, MaxConnectionsInPool);//NOI18N         
    
public voidsetMinConnectionsInPool(java.lang.String value)

        String oldValue = MinConnectionsInPool;
        this.MinConnectionsInPool = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("MinConnectionsInPool", oldValue, MinConnectionsInPool);//NOI18N
    
public voidsetName(java.lang.String value)

        String oldValue = name;
        this.name = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("name", oldValue, name);//NOI18N
    
public voidsetResType(java.lang.String val)

        String prev = this.ResType;
        this.ResType = val;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("ResType", prev, ResType);//NOI18N
    
public voidsetValidationTableName(java.lang.String value)

        String oldValue = ValidationTableName;
        this.ValidationTableName = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("ValidationTableName", oldValue, ValidationTableName);//NOI18N        
    
public voidsetXIsolationLevel(java.lang.String val)

        String prev = this.XIsolationLevel;
        this.XIsolationLevel = val;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("XIsolationLevel", prev, XIsolationLevel);//NOI18N
    
public voidsimpleSetId(java.lang.String value)

        this.id = value;
        setName(id);