1 26 27 package org.objectweb.jonas_web.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.AbsJonasEnvironmentElement; 30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList; 31 import org.objectweb.jonas_lib.deployment.xml.JonasMessageDestination; 32 import org.objectweb.jonas_lib.deployment.xml.TopLevelElement; 33 34 38 public class JonasWebApp extends AbsJonasEnvironmentElement implements TopLevelElement { 39 40 43 private String header = null; 44 45 48 private String host = null; 49 50 53 private String contextRoot = null; 54 55 56 59 private String port = null; 60 61 64 private String java2DelegationModel = null; 65 66 69 private JLinkedList jonasMessageDestinationList = null; 70 71 74 public JonasWebApp() { 75 super(); 76 jonasMessageDestinationList = new JLinkedList("jonas-message-destination"); 77 } 78 79 80 82 83 84 88 public void setHost(String host) { 89 this.host = host; 90 } 91 92 93 97 public void setContextRoot(String contextRoot) { 98 this.contextRoot = contextRoot; 99 } 100 101 102 106 public void setPort(String port) { 107 this.port = port; 108 } 109 110 111 115 public void setJava2DelegationModel(String java2DelegationModel) { 116 this.java2DelegationModel = java2DelegationModel; 117 } 118 119 120 124 public void setJonasMessageDestinationList(JLinkedList jonasMessageDestinationList) { 125 this.jonasMessageDestinationList = jonasMessageDestinationList; 126 } 127 128 132 public void addJonasMessageDestination(JonasMessageDestination jonasMessageDestination) { 133 jonasMessageDestinationList.add(jonasMessageDestination); 134 } 135 136 138 139 142 public String getHost() { 143 return host; 144 } 145 146 149 public String getContextRoot() { 150 return contextRoot; 151 } 152 153 156 public String getPort() { 157 return port; 158 } 159 160 163 public String getJava2DelegationModel() { 164 return java2DelegationModel; 165 } 166 167 170 public JLinkedList getJonasMessageDestinationList() { 171 return jonasMessageDestinationList; 172 } 173 174 175 176 181 public String toXML(int indent) { 182 StringBuffer sb = new StringBuffer (); 183 sb.append(indent(indent)); 184 if (header != null) { 185 sb.append(header); 186 } else { 187 sb.append("<jonas-web-app>\n"); 188 } 189 190 indent += 2; 191 192 sb.append(getJonasResourceEnvList().toXML(indent)); 194 195 sb.append(getJonasResourceList().toXML(indent)); 197 198 sb.append(getJonasEjbRefList().toXML(indent)); 200 201 sb.append(getJonasMessageDestinationRefList().toXML(indent)); 203 204 sb.append(jonasMessageDestinationList.toXML(indent)); 206 207 sb.append(getJonasServiceRefList().toXML(indent)); 209 210 sb.append(xmlElement(host, "host", indent)); 212 213 sb.append(xmlElement(contextRoot, "context-root", indent)); 215 216 sb.append(xmlElement(port, "port", indent)); 218 219 sb.append(xmlElement(java2DelegationModel, "java2-delegation-model", indent)); 221 222 indent -= 2; 223 sb.append(indent(indent)); 224 sb.append("</jonas-web-app>"); 225 226 return sb.toString(); 227 } 228 229 232 public String getHeader() { 233 return header; 234 } 235 236 239 public void setHeader(String header) { 240 this.header = header; 241 } 242 243 244 } 245 | Popular Tags |