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

BaseResource

public class BaseResource extends Object implements Serializable

Fields Summary
private String
name
private String
Description
protected String
JndiName
private String
ResType
private String
Enabled
protected transient PropertyChangeSupport
propertySupport
Constructors Summary
public BaseResource(List resources, String resName)

        propertySupport = new PropertyChangeSupport ( this );
        JndiName = "JndiName"; // NOI18N
        Description = ""; // NOI18N
        ResType = "ResourceType";//NOI18N
//        FactoryClassName = "FactoryClassName";
//        LogLevel = "ERROR";
        Enabled = "true"; // 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++){
        IResource instance = (IResource) 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.StringgetDescription()

        return Description;
    
public java.lang.StringgetEnabled()

        return Enabled;
    
public java.lang.StringgetJndiName()

        return JndiName;
    
public java.lang.StringgetName()

        return name;
    
public java.lang.StringgetResType()

        return ResType;
    
protected voidinitPropertyChangeSupport()

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

    
public voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)

        initPropertyChangeSupport();
        propertySupport.removePropertyChangeListener (listener);
    
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 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 voidsetResType(java.lang.String value)

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

        this.JndiName = value;
        setName(JndiName);