00001
00027 package org.objectweb.jonas_rar.deployment.api;
00028
00029 import java.util.Iterator;
00030 import java.util.List;
00031 import java.util.Vector;
00032
00033 import org.objectweb.jonas_lib.deployment.api.AbsDeploymentDesc;
00034
00035 import org.objectweb.jonas_rar.deployment.api.ConnectorDesc;
00036 import org.objectweb.jonas_rar.deployment.api.JonasConnectorDesc;
00037 import org.objectweb.jonas_rar.deployment.api.ConfigPropertyDesc;
00038 import org.objectweb.jonas_rar.deployment.api.JonasConfigPropertyDesc;
00039 import org.objectweb.jonas_rar.deployment.api.ResourceadapterDesc;
00040 import org.objectweb.jonas_rar.deployment.xml.ConfigProperty;
00041 import org.objectweb.jonas_rar.deployment.xml.Connector;
00042 import org.objectweb.jonas_rar.deployment.xml.JonasConfigProperty;
00043 import org.objectweb.jonas_rar.deployment.xml.JonasConnector;
00044
00045
00052 public class RarDeploymentDesc extends AbsDeploymentDesc {
00053
00054
00058 private Vector raConfigPropTags = null;
00059
00063 private Vector jonasConfigPropTags = null;
00064
00068 private Connector connector = null;
00069
00073 private ConnectorDesc connectorDesc = null;
00074
00078 private JonasConnectorDesc jonasConnectorDesc = null;
00079
00083 private String xmlContent = "";
00084
00088 private String jonasXmlContent = "";
00089
00090
00101 public RarDeploymentDesc(
00102 ClassLoader classLoader,
00103 Connector connector,
00104 JonasConnector jonasConnector)
00105 throws RarDeploymentDescException {
00106
00107
00108 if (classLoader == null) {
00109 throw new RarDeploymentDescException("DeploymentDesc: Classloader is null");
00110 }
00111
00112 this.connector = connector;
00113 this.connectorDesc = new ConnectorDesc(connector);
00114 this.jonasConnectorDesc = new JonasConnectorDesc(jonasConnector);
00115
00116 if (connectorDesc != null) {
00117
00118 displayName = null;
00119 if (connectorDesc.getDisplayName() != null) {
00120 displayName = connectorDesc.getDisplayName();
00121 }
00122
00123 raConfigPropTags = new Vector();
00124
00125 ResourceadapterDesc rd = connectorDesc.getResourceadapterDesc();
00126 if (rd != null) {
00127 for (Iterator i = rd.getConfigPropertyList().iterator(); i.hasNext(); ) {
00128 raConfigPropTags.add((ConfigPropertyDesc) i.next());
00129 }
00130 }
00131 }
00132
00133 if (jonasConnectorDesc != null &&
00134 jonasConnectorDesc.getJonasConfigPropertyList() != null) {
00135 jonasConfigPropTags = new Vector();
00136
00137 for (Iterator i =
00138 jonasConnectorDesc.getJonasConfigPropertyList().iterator();
00139 i.hasNext();
00140 ) {
00141 jonasConfigPropTags.add((JonasConfigPropertyDesc) i.next());
00142 }
00143 }
00144
00145 }
00146
00151 public void setRaConfigPropTags(Connector conn) {
00152
00153 for (Iterator i =
00154 conn.getResourceadapter().getConfigPropertyList().iterator();
00155 i.hasNext();
00156 ) {
00157 if (raConfigPropTags == null) {
00158 raConfigPropTags = new Vector();
00159 }
00160 raConfigPropTags.add(new ConfigPropertyDesc((ConfigProperty) i.next()));
00161 }
00162 if (raConfigPropTags == null) {
00163 return;
00164 }
00165 ConfigPropertyDesc[] tmp = new ConfigPropertyDesc[raConfigPropTags.size()];
00166 raConfigPropTags.copyInto(tmp);
00167 }
00168
00173 public ConfigPropertyDesc[] getRaConfigPropTags() {
00174 if (raConfigPropTags == null) {
00175 return null;
00176 }
00177 ConfigPropertyDesc[] tmp = new ConfigPropertyDesc[raConfigPropTags.size()];
00178 raConfigPropTags.copyInto(tmp);
00179 return tmp;
00180 }
00181
00186 public JonasConfigPropertyDesc[] getJonasConfigPropTags() {
00187 if (jonasConfigPropTags == null) {
00188 return null;
00189 }
00190 if (jonasConfigPropTags != null) {
00191 JonasConfigPropertyDesc[] tmp =
00192 new JonasConfigPropertyDesc[jonasConfigPropTags.size()];
00193 jonasConfigPropTags.copyInto(tmp);
00194 return tmp;
00195 }
00196 return null;
00197 }
00198
00203 public String toString() {
00204 String ret = "Connector :";
00205
00206 return ret;
00207 }
00208
00213 public Connector getConnector() {
00214 return connector;
00215 }
00216
00221 public ConnectorDesc getConnectorDesc() {
00222 return connectorDesc;
00223 }
00224
00229 public JonasConnectorDesc getJonasConnectorDesc() {
00230 return jonasConnectorDesc;
00231 }
00236 public String getXmlContent() {
00237 return xmlContent;
00238 }
00239
00244 public String getJOnASXmlContent() {
00245 return jonasXmlContent;
00246 }
00247
00252 public void setXmlContent(String xml) {
00253 xmlContent = xml;
00254 }
00255
00260 public void setJOnASXmlContent(String jXml) {
00261 jonasXmlContent = jXml;
00262 }
00263 }