1 26 27 package org.objectweb.jonas_rar.deployment.api; 28 29 import java.util.Iterator ; 30 import java.util.List ; 31 import java.util.Vector ; 32 33 import org.objectweb.jonas_lib.deployment.api.AbsDeploymentDesc; 34 35 import org.objectweb.jonas_rar.deployment.api.ConnectorDesc; 36 import org.objectweb.jonas_rar.deployment.api.JonasConnectorDesc; 37 import org.objectweb.jonas_rar.deployment.api.ConfigPropertyDesc; 38 import org.objectweb.jonas_rar.deployment.api.JonasConfigPropertyDesc; 39 import org.objectweb.jonas_rar.deployment.api.ResourceadapterDesc; 40 import org.objectweb.jonas_rar.deployment.xml.ConfigProperty; 41 import org.objectweb.jonas_rar.deployment.xml.Connector; 42 import org.objectweb.jonas_rar.deployment.xml.JonasConfigProperty; 43 import org.objectweb.jonas_rar.deployment.xml.JonasConnector; 44 45 46 52 public class RarDeploymentDesc extends AbsDeploymentDesc { 53 54 55 58 private Vector raConfigPropTags = null; 59 60 63 private Vector jonasConfigPropTags = null; 64 65 68 private Connector connector = null; 69 70 73 private ConnectorDesc connectorDesc = null; 74 75 78 private JonasConnectorDesc jonasConnectorDesc = null; 79 80 83 private String xmlContent = ""; 84 85 88 private String jonasXmlContent = ""; 89 90 91 101 public RarDeploymentDesc( 102 ClassLoader classLoader, 103 Connector connector, 104 JonasConnector jonasConnector) 105 throws RarDeploymentDescException { 106 107 if (classLoader == null) { 109 throw new RarDeploymentDescException("DeploymentDesc: Classloader is null"); 110 } 111 112 this.connector = connector; 113 this.connectorDesc = new ConnectorDesc(connector); 114 this.jonasConnectorDesc = new JonasConnectorDesc(jonasConnector); 115 116 if (connectorDesc != null) { 117 displayName = null; 119 if (connectorDesc.getDisplayName() != null) { 120 displayName = connectorDesc.getDisplayName(); 121 } 122 123 raConfigPropTags = new Vector (); 124 ResourceadapterDesc rd = connectorDesc.getResourceadapterDesc(); 126 if (rd != null) { 127 for (Iterator i = rd.getConfigPropertyList().iterator(); i.hasNext(); ) { 128 raConfigPropTags.add((ConfigPropertyDesc) i.next()); 129 } 130 } 131 } 132 133 if (jonasConnectorDesc != null && 134 jonasConnectorDesc.getJonasConfigPropertyList() != null) { 135 jonasConfigPropTags = new Vector (); 136 for (Iterator i = 138 jonasConnectorDesc.getJonasConfigPropertyList().iterator(); 139 i.hasNext(); 140 ) { 141 jonasConfigPropTags.add((JonasConfigPropertyDesc) i.next()); 142 } 143 } 144 145 } 146 147 151 public void setRaConfigPropTags(Connector conn) { 152 for (Iterator i = 154 conn.getResourceadapter().getConfigPropertyList().iterator(); 155 i.hasNext(); 156 ) { 157 if (raConfigPropTags == null) { 158 raConfigPropTags = new Vector (); 159 } 160 raConfigPropTags.add(new ConfigPropertyDesc((ConfigProperty) i.next())); 161 } 162 if (raConfigPropTags == null) { 163 return; 164 } 165 ConfigPropertyDesc[] tmp = new ConfigPropertyDesc[raConfigPropTags.size()]; 166 raConfigPropTags.copyInto(tmp); 167 } 168 169 173 public ConfigPropertyDesc[] getRaConfigPropTags() { 174 if (raConfigPropTags == null) { 175 return null; 176 } 177 ConfigPropertyDesc[] tmp = new ConfigPropertyDesc[raConfigPropTags.size()]; 178 raConfigPropTags.copyInto(tmp); 179 return tmp; 180 } 181 182 186 public JonasConfigPropertyDesc[] getJonasConfigPropTags() { 187 if (jonasConfigPropTags == null) { 188 return null; 189 } 190 if (jonasConfigPropTags != null) { 191 JonasConfigPropertyDesc[] tmp = 192 new JonasConfigPropertyDesc[jonasConfigPropTags.size()]; 193 jonasConfigPropTags.copyInto(tmp); 194 return tmp; 195 } 196 return null; 197 } 198 199 203 public String toString() { 204 String ret = "Connector :"; 205 206 return ret; 207 } 208 209 213 public Connector getConnector() { 214 return connector; 215 } 216 217 221 public ConnectorDesc getConnectorDesc() { 222 return connectorDesc; 223 } 224 225 229 public JonasConnectorDesc getJonasConnectorDesc() { 230 return jonasConnectorDesc; 231 } 232 236 public String getXmlContent() { 237 return xmlContent; 238 } 239 240 244 public String getJOnASXmlContent() { 245 return jonasXmlContent; 246 } 247 248 252 public void setXmlContent(String xml) { 253 xmlContent = xml; 254 } 255 256 260 public void setJOnASXmlContent(String jXml) { 261 jonasXmlContent = jXml; 262 } 263 } 264 | Popular Tags |