1 27 package org.objectweb.jonas_rar.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.AbsElement; 30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList; 31 36 37 public class ConnectionDefinition extends AbsElement { 38 39 42 private String id = null; 43 44 47 private String managedconnectionfactoryClass = null; 48 49 52 private JLinkedList configPropertyList = null; 53 54 57 private String connectionfactoryInterface = null; 58 59 62 private String connectionfactoryImplClass = null; 63 64 67 private String connectionInterface = null; 68 69 72 private String connectionImplClass = null; 73 74 75 78 public ConnectionDefinition() { 79 super(); 80 configPropertyList = new JLinkedList("config-property"); 81 } 82 83 87 public String getId() { 88 return id; 89 } 90 91 95 public void setId(String id) { 96 this.id = id; 97 } 98 99 103 public String getManagedconnectionfactoryClass() { 104 return managedconnectionfactoryClass; 105 } 106 107 111 public void setManagedconnectionfactoryClass(String managedconnectionfactoryClass) { 112 this.managedconnectionfactoryClass = managedconnectionfactoryClass; 113 } 114 115 119 public JLinkedList getConfigPropertyList() { 120 return configPropertyList; 121 } 122 123 127 public void setConfigPropertyList(JLinkedList configPropertyList) { 128 this.configPropertyList = configPropertyList; 129 } 130 131 135 public void addConfigProperty(ConfigProperty configProperty) { 136 configPropertyList.add(configProperty); 137 } 138 139 143 public String getConnectionfactoryInterface() { 144 return connectionfactoryInterface; 145 } 146 147 151 public void setConnectionfactoryInterface(String connectionfactoryInterface) { 152 this.connectionfactoryInterface = connectionfactoryInterface; 153 } 154 155 159 public String getConnectionfactoryImplClass() { 160 return connectionfactoryImplClass; 161 } 162 163 167 public void setConnectionfactoryImplClass(String connectionfactoryImplClass) { 168 this.connectionfactoryImplClass = connectionfactoryImplClass; 169 } 170 171 175 public String getConnectionInterface() { 176 return connectionInterface; 177 } 178 179 183 public void setConnectionInterface(String connectionInterface) { 184 this.connectionInterface = connectionInterface; 185 } 186 187 191 public String getConnectionImplClass() { 192 return connectionImplClass; 193 } 194 195 199 public void setConnectionImplClass(String connectionImplClass) { 200 this.connectionImplClass = connectionImplClass; 201 } 202 203 204 209 public String toXML(int indent) { 210 StringBuffer sb = new StringBuffer (); 211 sb.append(indent(indent)); 212 sb.append("<connection-definition"); 213 sb.append(xmlAttribute(id, "id")); 214 sb.append(">\n"); 215 216 indent += 2; 217 218 sb.append(xmlElement(managedconnectionfactoryClass, "managedconnectionfactory-class", indent)); 220 sb.append(configPropertyList.toXML(indent)); 222 sb.append(xmlElement(connectionfactoryInterface, "connectionfactory-interface", indent)); 224 sb.append(xmlElement(connectionfactoryImplClass, "connectionfactory-impl-class", indent)); 226 sb.append(xmlElement(connectionInterface, "connection-interface", indent)); 228 sb.append(xmlElement(connectionImplClass, "connection-impl-class", indent)); 230 indent -= 2; 231 sb.append(indent(indent)); 232 sb.append("</connection-definition>\n"); 233 234 return sb.toString(); 235 } 236 } 237 | Popular Tags |