1 27 package org.objectweb.jonas_ejb.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.AbsElement; 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 39 40 public class JonasEjbJar extends AbsElement implements TopLevelElement { 41 42 45 private String header = null; 46 47 50 private JLinkedList jonasSessionList = null; 51 52 55 private JLinkedList jonasEntityList = null; 56 57 60 private JLinkedList jonasMessageDrivenList = null; 61 62 65 private JLinkedList jonasEjbRelationList = null; 66 67 70 private JLinkedList jonasMessageDestinationList = null; 71 72 75 private JLinkedList jonasRunAsMappingList = null; 76 77 78 81 public JonasEjbJar() { 82 super(); 83 jonasSessionList = new JLinkedList("jonas-session"); 84 jonasEntityList = new JLinkedList("jonas-entity"); 85 jonasMessageDrivenList = new JLinkedList("jonas-message-driven"); 86 jonasEjbRelationList = new JLinkedList("jonas-ejb-relation"); 87 jonasMessageDestinationList = new JLinkedList("jonas-message-destination"); 88 jonasRunAsMappingList = new JLinkedList("jonas-run-as-mapping"); 89 } 90 91 95 public JLinkedList getJonasRunAsMappingList() { 96 return jonasRunAsMappingList; 97 } 98 99 103 public JLinkedList getJonasSessionList() { 104 return jonasSessionList; 105 } 106 107 111 public void setJonasSessionList(JLinkedList jonasSessionList) { 112 this.jonasSessionList = jonasSessionList; 113 } 114 115 119 public void addJonasRunAsMapping(JonasRunAsMapping jonasRunAsMapping) { 120 jonasRunAsMappingList.add(jonasRunAsMapping); 121 } 122 123 127 public void addJonasSession(JonasSession jonasSession) { 128 jonasSessionList.add(jonasSession); 129 } 130 131 135 public JLinkedList getJonasEntityList() { 136 return jonasEntityList; 137 } 138 139 143 public void setJonasEntityList(JLinkedList jonasEntityList) { 144 this.jonasEntityList = jonasEntityList; 145 } 146 147 151 public void addJonasEntity(JonasEntity jonasEntity) { 152 jonasEntityList.add(jonasEntity); 153 } 154 155 159 public JLinkedList getJonasMessageDrivenList() { 160 return jonasMessageDrivenList; 161 } 162 163 167 public void setJonasMessageDrivenList(JLinkedList jonasMessageDrivenList) { 168 this.jonasMessageDrivenList = jonasMessageDrivenList; 169 } 170 171 175 public void addJonasMessageDriven(JonasMessageDriven jonasMessageDriven) { 176 jonasMessageDrivenList.add(jonasMessageDriven); 177 } 178 179 183 public JLinkedList getJonasEjbRelationList() { 184 return jonasEjbRelationList; 185 } 186 187 191 public void setJonasEjbRelationList(JLinkedList jonasEjbRelationList) { 192 this.jonasEjbRelationList = jonasEjbRelationList; 193 } 194 195 199 public void addJonasEjbRelation(JonasEjbRelation jonasEjbRelation) { 200 jonasEjbRelationList.add(jonasEjbRelation); 201 } 202 203 206 public JLinkedList getJonasMessageDestinationList() { 207 return jonasMessageDestinationList; 208 } 209 210 214 public void setJonasMessageDestinationList(JLinkedList jonasMessageDestinationList) { 215 this.jonasMessageDestinationList = jonasMessageDestinationList; 216 } 217 218 222 public void addJonasMessageDestination(JonasMessageDestination jonasMessageDestination) { 223 jonasMessageDestinationList.add(jonasMessageDestination); 224 } 225 226 231 public String toXML(int indent) { 232 StringBuffer sb = new StringBuffer (); 233 sb.append(indent(indent)); 234 if (header != null) { 235 sb.append(header); 236 } else { 237 sb.append("<jonas-ejb-jar>"); 238 } 239 240 indent += 2; 241 242 sb.append(jonasSessionList.toXML(indent)); 244 sb.append(jonasEntityList.toXML(indent)); 246 sb.append(jonasMessageDrivenList.toXML(indent)); 248 sb.append(jonasEjbRelationList.toXML(indent)); 250 sb.append(jonasMessageDestinationList.toXML(indent)); 252 sb.append(jonasRunAsMappingList.toXML(indent)); 254 indent -= 2; 255 sb.append(indent(indent)); 256 sb.append("</jonas-ejb-jar>\n"); 257 258 return sb.toString(); 259 } 260 261 264 public String getHeader() { 265 return header; 266 } 267 268 271 public void setHeader(String header) { 272 this.header = header; 273 } 274 } 275 | Popular Tags |