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 36 37 public class EnterpriseBeans extends AbsElement { 38 39 42 private JLinkedList sessionList = null; 43 44 47 private JLinkedList entityList = null; 48 49 52 private JLinkedList messageDrivenList = null; 53 54 55 58 public EnterpriseBeans() { 59 super(); 60 sessionList = new JLinkedList("session"); 61 entityList = new JLinkedList("entity"); 62 messageDrivenList = new JLinkedList("message-driven"); 63 } 64 65 69 public JLinkedList getSessionList() { 70 return sessionList; 71 } 72 73 77 public void setSessionList(JLinkedList sessionList) { 78 this.sessionList = sessionList; 79 } 80 81 85 public void addSession(Session session) { 86 sessionList.add(session); 87 } 88 89 93 public JLinkedList getEntityList() { 94 return entityList; 95 } 96 97 101 public void setEntityList(JLinkedList entityList) { 102 this.entityList = entityList; 103 } 104 105 109 public void addEntity(Entity entity) { 110 entityList.add(entity); 111 } 112 113 117 public JLinkedList getMessageDrivenList() { 118 return messageDrivenList; 119 } 120 121 125 public void setMessageDrivenList(JLinkedList messageDrivenList) { 126 this.messageDrivenList = messageDrivenList; 127 } 128 129 133 public void addMessageDriven(MessageDriven messageDriven) { 134 messageDrivenList.add(messageDriven); 135 } 136 137 142 public String toXML(int indent) { 143 StringBuffer sb = new StringBuffer (); 144 sb.append(indent(indent)); 145 sb.append("<enterprise-beans>\n"); 146 147 indent += 2; 148 149 sb.append(sessionList.toXML(indent)); 151 sb.append(entityList.toXML(indent)); 153 sb.append(messageDrivenList.toXML(indent)); 155 indent -= 2; 156 sb.append(indent(indent)); 157 sb.append("</enterprise-beans>\n"); 158 159 return sb.toString(); 160 } 161 } 162 | Popular Tags |