1 27 package org.objectweb.jonas_client.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 39 public class JonasClient extends AbsJonasEnvironmentElement implements TopLevelElement { 40 41 44 private String header = null; 45 46 49 private JonasSecurity jonasSecurity = null; 50 51 54 private JLinkedList jonasMessageDestinationList = null; 55 56 57 60 public JonasClient() { 61 super(); 62 jonasMessageDestinationList = new JLinkedList("jonas-message-destination"); 63 } 64 65 68 public JonasSecurity getJonasSecurity() { 69 return jonasSecurity; 70 } 71 72 76 public void setJonasSecurity(JonasSecurity jonasSecurity) { 77 this.jonasSecurity = jonasSecurity; 78 } 79 80 83 public JLinkedList getJonasMessageDestinationList() { 84 return jonasMessageDestinationList; 85 } 86 87 91 public void setJonasMessageDestinationList(JLinkedList jonasMessageDestinationList) { 92 this.jonasMessageDestinationList = jonasMessageDestinationList; 93 } 94 95 99 public void addJonasMessageDestination(JonasMessageDestination jonasMessageDestination) { 100 jonasMessageDestinationList.add(jonasMessageDestination); 101 } 102 103 108 public String toXML(int indent) { 109 StringBuffer sb = new StringBuffer (); 110 sb.append(indent(indent)); 111 if (header != null) { 112 sb.append(header); 113 } else { 114 sb.append("<jonas-client>\n"); 115 } 116 117 indent += 2; 118 119 sb.append(getJonasEjbRefList().toXML(indent)); 121 sb.append(getJonasResourceList().toXML(indent)); 123 sb.append(getJonasResourceEnvList().toXML(indent)); 125 if (jonasSecurity != null) { 127 sb.append(jonasSecurity.toXML(indent)); 128 } 129 sb.append(getJonasServiceRefList().toXML(indent)); 131 sb.append(getJonasMessageDestinationRefList().toXML(indent)); 133 sb.append(jonasMessageDestinationList.toXML(indent)); 135 indent -= 2; 136 sb.append(indent(indent)); 137 sb.append("</jonas-client>\n"); 138 139 return sb.toString(); 140 } 141 142 145 public String getHeader() { 146 return header; 147 } 148 149 152 public void setHeader(String header) { 153 this.header = header; 154 } 155 } | Popular Tags |