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

PersistenceManager

public class PersistenceManager extends Object implements Serializable

Fields Summary
private String
name
private String
Description
private String
JndiName
private String
FactoryClassName
private String
Enabled
private NameValuePair[]
extParams
private String
DataSourceName
protected transient PropertyChangeSupport
propertySupport
Constructors Summary
public PersistenceManager(List resources)


       
        propertySupport = new PropertyChangeSupport ( this );
        //JndiName = "pmf/";//NOI18N
        JndiName = "jdo/";//NOI18N
        Description = ""; // NOI18N
 //       ResType = "javax.sql.DataSource";//NOI18N
        FactoryClassName = "com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl";//NOI18N
 //       LogLevel = "ERROR";
        Enabled = "true"; // NOI18N
 //       extParams = new Vector();
        
        DataSourceName = "jdbc/";//NOI18N
/*        
        IgnoreCache = "false";//NOI18N
        NonTXRead = "false";//NOI18N
        NonTXWrite = "false";//NOI18N
        Optimistic = "false";//NOI18N
        RetainValue = "false";//NOI18N
*/        
        String resName = "PersistenceManager"; // NOI18N
        String t_name = null;
        if(resources.size() != 0){
           int num = resources.size()+1; 
           t_name = resName + "_" + num;//NOI18N
           boolean resource_exists = FactoryName(t_name, resources);
           while(resource_exists){
             num++;
             t_name = resName + "_" + num;//NOI18N
             resource_exists = FactoryName(t_name, resources);
           }
        }else{
          t_name = resName + "_1";//NOI18N
        }
        name = t_name;
    
Methods Summary
public booleanFactoryName(java.lang.String value, java.util.List resources)

      boolean exists = false;  
      for(int i=0; i<resources.size(); i++){
        IPMFactory instance = (IPMFactory) 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.StringgetDataSourceName()

        return DataSourceName;
    
public java.lang.StringgetDescription()

        return Description;
    
public java.lang.StringgetEnabled()

        return Enabled;
    
public NameValuePair[]getExtParams()

        return extParams;
    
public java.lang.StringgetFactoryClassName()

        return FactoryClassName;
    
public java.lang.StringgetJndiName()

        return JndiName;
    
public java.lang.StringgetName()

        return name;
    
private voidinitPropertyChangeSupport()

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

    
public voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)

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

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

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

        String oldValue = Enabled;
        this.Enabled = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("Enabled", oldValue, Enabled);//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() + "  " + pair.getParamDescription()); //NOI18N
            pairs[i] = pair;
        }
        NameValuePair[] oldValue = extParams;
        this.extParams = pairs;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("extParams", oldValue, extParams);//NOI18N
    
public voidsetFactoryClassName(java.lang.String value)

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

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

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

        this.JndiName = value;
        setName(JndiName);
    
public java.lang.StringtoString()

        return "name: " + getName() + ", Description: " + getDescription() + ", JndiName: " + // NOI18N
          getJndiName()  + ", FactoryClassName: " + // NOI18N
          getFactoryClassName() + ", Enabled: " + getEnabled(); // NOI18N