1 22 package org.jboss.metadata; 23 24 import org.w3c.dom.Element ; 25 26 import org.jboss.deployment.DeploymentException; 27 28 34 public class MessageDestinationRefMetaData extends Ref 35 { 36 38 public static final int CONSUMES = 1; 39 public static final int PRODUCES = 2; 40 public static final int CONSUMESPRODUCES = 3; 41 42 44 45 private String refName; 46 47 48 private String type; 49 50 51 private int usage; 52 53 54 private String link; 55 56 57 private String jndiName; 58 59 61 63 public MessageDestinationRefMetaData() 64 { 65 } 66 67 69 public String getJndiName() 70 { 71 return jndiName; 72 } 73 74 public void setJndiName(String jndiName) 75 { 76 this.jndiName = jndiName; 77 } 78 82 public String getJNDIName() 83 { 84 return jndiName; 85 } 86 87 public String getLink() 88 { 89 return link; 90 } 91 92 public void setLink(String link) 93 { 94 this.link = link; 95 } 96 97 public String getRefName() 98 { 99 return refName; 100 } 101 102 public void setRefName(String refName) 103 { 104 this.refName = refName; 105 } 106 107 public String getType() 108 { 109 return type; 110 } 111 112 public void setType(String type) 113 { 114 this.type = type; 115 } 116 117 public int getUsage() 118 { 119 return usage; 120 } 121 122 public void setUsage(int usage) 123 { 124 this.usage = usage; 125 } 126 public void setUsage(String usageValue) 127 { 128 if (usageValue.equalsIgnoreCase("Consumes")) 129 usage = CONSUMES; 130 else if (usageValue.equalsIgnoreCase("Produces")) 131 usage = PRODUCES; 132 else if (usageValue.equalsIgnoreCase("ConsumesProduces")) 133 usage = CONSUMESPRODUCES; 134 } 135 136 public void importEjbJarXml(Element element) throws DeploymentException 137 { 138 refName = MetaData.getElementContent(MetaData.getUniqueChild(element, "message-destination-ref-name")); 139 140 type = MetaData.getElementContent(MetaData.getUniqueChild(element, "message-destination-type")); 141 142 String usageValue = MetaData.getElementContent(MetaData.getUniqueChild(element, "message-destination-usage")); 143 usageValue = usageValue.trim(); 144 if (usageValue.equalsIgnoreCase("Consumes")) 145 usage = CONSUMES; 146 else if (usageValue.equalsIgnoreCase("Produces")) 147 usage = PRODUCES; 148 else if (usageValue.equalsIgnoreCase("ConsumesProduces")) 149 usage = CONSUMESPRODUCES; 150 else 151 throw new DeploymentException("message-destination-usage should be one of Consumes, Produces, ConsumesProduces"); 152 153 Element child = MetaData.getOptionalChild(element, "message-destination-link"); 154 if (child != null) 155 link = MetaData.getElementContent(child); 156 } 157 158 public void importJbossXml(Element element) throws DeploymentException 159 { 160 jndiName = MetaData.getElementContent(MetaData.getUniqueChild(element, "jndi-name")); 161 } 162 163 165 167 169 } 171 | Popular Tags |