001: package org.objectweb.celtix.tools.extensions.jms;
002:
003: import java.io.*;
004: import javax.wsdl.extensions.ExtensibilityElement;
005: import javax.xml.namespace.QName;
006: import org.w3c.dom.*;
007:
008: public class JMSAddress implements ExtensibilityElement, Serializable {
009: // private String address;
010: private String address;
011: private Element element;
012: private boolean required;
013: private QName elementType;
014: private String documentBaseURI;
015:
016: // attributes used by jms:address element
017: private String destinationStyle = "queue";
018: private String initialContextFactory = "org.activemq.jndi.ActiveMQInitialContextFactory";
019: private String jndiConnectionFactoryName = "ConnectionFactory";
020: private String messageType = "text";
021:
022: private String jndiProviderURL;
023: private String jndiDestinationName;
024: private String durableSubscriberName;
025: private boolean useMessageIDAsCorrelationID = true;
026:
027: public void setDocumentBaseURI(String baseURI) {
028: this .documentBaseURI = baseURI;
029: }
030:
031: public String getDocumentBaseURI() {
032: return this .documentBaseURI;
033: }
034:
035: public void setElement(Element elem) {
036: this .element = elem;
037: }
038:
039: public Element getElement() {
040: return element;
041: }
042:
043: public void setRequired(Boolean r) {
044: this .required = r;
045: }
046:
047: public Boolean getRequired() {
048: return required;
049: }
050:
051: public void setElementType(QName elemType) {
052: this .elementType = elemType;
053: }
054:
055: public QName getElementType() {
056: return elementType;
057: }
058:
059: public void setJndiProviderURL(String url) {
060: this .jndiProviderURL = url;
061: }
062:
063: public String getJndiProviderURL() {
064: return this .jndiProviderURL;
065: }
066:
067: public String getDestinationStyle() {
068: return destinationStyle;
069: }
070:
071: public String getDurableSubscriberName() {
072: return durableSubscriberName;
073: }
074:
075: public void setDurableSubscriberName(String newDurableSubscriberName) {
076: durableSubscriberName = newDurableSubscriberName;
077: }
078:
079: public String getInitialContextFactory() {
080: return initialContextFactory;
081: }
082:
083: public void setInitialContextFactory(String newInitContextFactory) {
084: initialContextFactory = newInitContextFactory;
085: }
086:
087: public String getJndiConnectionFactoryName() {
088: return jndiConnectionFactoryName;
089: }
090:
091: public void setJndiConnectionFactoryName(
092: String newJndiConnectionFactoryName) {
093: jndiConnectionFactoryName = newJndiConnectionFactoryName;
094: }
095:
096: public String getJndiDestinationName() {
097: return jndiDestinationName;
098: }
099:
100: public void setJndiDestinationName(String newJndiDestinationName) {
101: jndiDestinationName = newJndiDestinationName;
102: }
103:
104: public String getMessageType() {
105: return messageType;
106: }
107:
108: public void setMessageType(String newMessageType) {
109: messageType = newMessageType;
110: }
111:
112: public boolean isUseMessageIDAsCorrelationID() {
113: return useMessageIDAsCorrelationID;
114: }
115:
116: public void setUseMessageIDAsCorrelationID(
117: boolean newUseMessageIDAsCorrelationID) {
118: useMessageIDAsCorrelationID = newUseMessageIDAsCorrelationID;
119: }
120:
121: public void setDestinationStyle(String newDestinationStyle) {
122: destinationStyle = newDestinationStyle;
123: }
124:
125: public String getAddress() {
126: return address;
127: }
128:
129: public void setAddress(String newAddress) {
130: address = newAddress;
131: }
132:
133: public String getAttrXMLString() {
134: StringBuffer sb = new StringBuffer(300);
135: if (destinationStyle != null) {
136: sb.append("destinationStyle=\"" + destinationStyle + "\" ");
137: }
138: if (initialContextFactory != null) {
139: sb.append("initialContextFactory=\""
140: + initialContextFactory + "\" ");
141: }
142: if (jndiConnectionFactoryName != null) {
143: sb.append("jndiConnectionFactoryName=\""
144: + jndiConnectionFactoryName + "\" ");
145: }
146: if (messageType != null) {
147: sb.append("messageType=\"" + messageType + "\" ");
148: }
149: if (jndiProviderURL != null) {
150: sb.append("jndiProviderURL=\"" + jndiProviderURL + "\" ");
151: }
152: if (jndiDestinationName != null) {
153: sb.append("jndiDestinationName=\"" + jndiDestinationName
154: + "\" ");
155: }
156: if (durableSubscriberName != null) {
157: sb.append("durableSubscriberName=\""
158: + durableSubscriberName + "\" ");
159: }
160: sb.append("useMessageIDAsCorrelationID=\""
161: + String.valueOf(useMessageIDAsCorrelationID) + "\" ");
162:
163: return sb.toString();
164: }
165: }
|