1 23 24 package com.sun.enterprise.admin.server.core.mbean.config; 25 26 import java.util.Vector ; 27 import java.util.Properties ; 28 29 import com.sun.enterprise.config.serverbeans.ElementProperty; 30 31 34 public class Resource 35 { 36 public final static int BEGIN_INDEX = 0; 37 public final static int JMS_RESOURCE = BEGIN_INDEX + 1; 38 public final static int MAIL_RESOURCE = BEGIN_INDEX + 2; 39 public final static int PERSISTENCE_RESOURCE = BEGIN_INDEX + 3; 40 public final static int JDBC_RESOURCE = BEGIN_INDEX + 4; 41 public final static int JDBC_CONN_POOL = BEGIN_INDEX + 5; 42 public final static int CUSTOM_RESOURCE = BEGIN_INDEX + 6; 43 public final static int EXT_JNDI_RESOURCE = BEGIN_INDEX + 7; 44 45 private int resType = 0; 46 private Properties attributes = new Properties (); 47 private Vector vProperty = new Vector (); 48 private String sDescription = null; 49 50 public Resource() 51 { 52 } 53 54 public Resource(int type) 55 { 56 resType = type; 57 } 58 59 public int getType() 60 { 61 return resType; 62 } 63 64 public void setType(int type) 65 { 66 resType = type; 67 } 68 69 public Properties getAttributes() 70 { 71 return attributes; 72 } 73 74 public void setAttribute(String name, String value) 75 { 76 attributes.setProperty(name, value); 77 } 78 79 public void setDescription(String sDescription) 80 { 81 this.sDescription = sDescription; 82 } 83 84 public String getDescription() 85 { 86 return sDescription; 87 } 88 89 public void setElementProperty(String name, String value) 90 { 91 ElementProperty ep = new ElementProperty(); 92 ep.setName(name); 93 ep.setValue(value); 94 vProperty.add(ep); 95 } 96 97 public void setElementProperty(String name, String value, String sDesc) 98 { 99 ElementProperty ep = new ElementProperty(); 100 ep.setName(name); 101 ep.setValue(value); 102 ep.setDescription(sDesc); 103 vProperty.add(ep); 104 } 105 106 public ElementProperty[] getElementProperty() 107 { 108 Object [] arrayObj = vProperty.toArray(); 109 ElementProperty [] epArray = new ElementProperty[arrayObj.length]; 111 for (int ii=0; ii<arrayObj.length; ii++) { 112 epArray[ii] = (ElementProperty)arrayObj[ii]; 113 } 114 return epArray; 115 } 116 } 117 | Popular Tags |