KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > transport > jms > JMSConstants


1 /*
2  * Copyright 2001, 2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.axis.transport.jms;
18
19 import javax.jms.DeliveryMode JavaDoc;
20 import javax.jms.Message JavaDoc;
21 import javax.jms.Session JavaDoc;
22
23 /**
24  * JMSConstants contains constants that apply to all JMS providers.
25  *
26  * <code>JMSConstants</code> contains the constant definitions for
27  * interacting with the WSClient. The most important constants are the
28  * <code>HashMap</code> keys for use in the arguments to the
29  * <code>send, call, registerListener, unregisterListener</code> methods of
30  * <code>JMSEndpoint</code> and the <code>createConnector</code> method of
31  * <code>JMSConnectorFactory</code>.
32  *
33  * @author Jaime Meritt (jmeritt@sonicsoftware.com)
34  * @author Richard Chung (rchung@sonicsoftware.com)
35  * @author Dave Chappell (chappell@sonicsoftware.com)
36  * @author Ray Chun (rchun@sonicsoftware.com)
37  */

38
39 public interface JMSConstants
40 {
41     public final static String JavaDoc PROTOCOL = "jms";
42
43     // abbreviated version of all constants (see below for description of each constant)
44
// the short name is used in the JMS URL. the full name is used in the Axis call.
45
final static String JavaDoc _WAIT_FOR_RESPONSE = "waitForResponse";
46     final static String JavaDoc _CLIENT_ID = "clientID";
47     final static String JavaDoc _VENDOR = "vendor";
48     final static String JavaDoc _DOMAIN = "domain";
49     final static String JavaDoc _JMS_CORRELATION_ID = "jmsCorrelationID";
50     final static String JavaDoc _JMS_CORRELATION_ID_AS_BYTES = "jmsCorrelationIDAsBytes";
51     final static String JavaDoc _JMS_TYPE = "jmsType";
52     final static String JavaDoc _TIME_TO_LIVE = "ttl";
53     final static String JavaDoc _PRIORITY = "priority";
54     final static String JavaDoc _DELIVERY_MODE = "deliveryMode";
55     final static String JavaDoc _MESSAGE_SELECTOR = "messageSelector";
56     final static String JavaDoc _ACKNOWLEDGE_MODE = "acknowledgeMode";
57     final static String JavaDoc _SUBSCRIPTION_NAME = "subscriptionName";
58     final static String JavaDoc _UNSUBSCRIBE = "unsubscribe";
59     final static String JavaDoc _NO_LOCAL = "noLocal";
60     final static String JavaDoc _NUM_RETRIES = "numRetries";
61     final static String JavaDoc _NUM_SESSIONS = "numSessions";
62     final static String JavaDoc _CONNECT_RETRY_INTERVAL = "connectRetryInterval";
63     final static String JavaDoc _INTERACT_RETRY_INTERVAL = "interactRetryInterval";
64     final static String JavaDoc _TIMEOUT_TIME = "timeoutTime";
65     final static String JavaDoc _MIN_TIMEOUT_TIME = "minTimeoutTime";
66     /** Defines a prefix added to each application-specific property in the
67      * JMS URL that should be added to the JMS Message when issued.
68      */

69     final static String JavaDoc _MSG_PROP_PREFIX = "msgProp.";
70
71     public static String JavaDoc JMS_PROPERTY_PREFIX = "transport.jms.";
72
73     /**
74      * This is used as a key in the Call properties telling the JMS transport
75      * to wait for a response from the service. The default value is true.
76      * If false is specified, the message will be delivered without specifying
77      * a ReplyTo. The client will always return null from invoke unless
78      * a client-side exception is thrown (similar to invokeOneWay in semantics)
79      * The value must be a <code>java.lang.Boolean</code>.
80      * See the javax.jms javadoc for information on this property.
81      */

82     final static String JavaDoc WAIT_FOR_RESPONSE = JMS_PROPERTY_PREFIX + _WAIT_FOR_RESPONSE;
83
84     /**
85      * <code>JMSConnectorFactory</code> parameter valid for either domain. This should
86      * be used as a key in the environment map passed into calls to
87      * <code>createConnector</code> in <code>JMSConnectorFactory</code>
88      * This is a required property for durable subscribers.
89      * The value must be a <code>java.lang.String</code>.
90      * See the javax.jms javadoc for information on this property.
91      */

92     final static String JavaDoc CLIENT_ID = JMS_PROPERTY_PREFIX + _CLIENT_ID;
93
94     // there is no short version
95
final static String JavaDoc DESTINATION = JMS_PROPERTY_PREFIX + "Destination";
96
97     final static String JavaDoc VENDOR = JMS_PROPERTY_PREFIX + _VENDOR;
98     public final static String JavaDoc JNDI_VENDOR_ID = "JNDI";
99
100     final static String JavaDoc DOMAIN = JMS_PROPERTY_PREFIX + _DOMAIN;
101
102     final static String JavaDoc DOMAIN_QUEUE = "QUEUE";
103     final static String JavaDoc DOMAIN_TOPIC = "TOPIC";
104     final static String JavaDoc DOMAIN_DEFAULT = DOMAIN_QUEUE;
105
106     /**
107      * Key for properties used in the <code>send</code> and <code>call</code>
108      * methods. It is valid for either domain.
109      * The value must be a <code>java.lang.String</code>.
110      * See the javax.jms javadoc for information on this property.
111      */

112     final static String JavaDoc JMS_CORRELATION_ID = JMS_PROPERTY_PREFIX + _JMS_CORRELATION_ID;
113     /**
114      * Key for properties used in the <code>send</code> and <code>call</code>
115      * methods. It is valid for either domain.
116      * The value must be a <code>byte[]</code>.
117      * See the javax.jms javadoc for information on this property.
118      */

119     final static String JavaDoc JMS_CORRELATION_ID_AS_BYTES = JMS_PROPERTY_PREFIX + _JMS_CORRELATION_ID_AS_BYTES;
120     /**
121      * Key for properties used in the <code>send</code> and <code>call</code>
122      * methods. It is valid for either domain.
123      * The value must be a <code>java.lang.String</code>.
124      * See the javax.jms javadoc for information on this property.
125      */

126     final static String JavaDoc JMS_TYPE = JMS_PROPERTY_PREFIX + _JMS_TYPE;
127     /**
128      * Key for properties used in the <code>send</code> and <code>call</code>
129      * methods. It is valid for either domain.
130      * The value must be a <code>java.lang.Long</code>.
131      * See the javax.jms javadoc for information on this property.
132      */

133     final static String JavaDoc TIME_TO_LIVE = JMS_PROPERTY_PREFIX + _TIME_TO_LIVE;
134     /**
135      * Key for properties used in the <code>send</code> and <code>call</code>
136      * methods. It is valid for either domain.
137      * The value must be a <code>java.lang.Integer</code>.
138      * See the javax.jms javadoc for information on this property.
139      */

140     final static String JavaDoc PRIORITY = JMS_PROPERTY_PREFIX + _PRIORITY;
141     /**
142      * Key for properties used in the <code>send</code> and <code>call</code>
143      * methods. It is valid for either domain.
144      * The value must be a <code>java.lang.Integer</code> equal to
145      * DeliveryMode.NON_PERSISTENT or DeliveryMode.PERSISTENT.
146      * See the javax.jms javadoc for information on this property.
147      */

148     final static String JavaDoc DELIVERY_MODE = JMS_PROPERTY_PREFIX + _DELIVERY_MODE;
149
150     final static String JavaDoc DELIVERY_MODE_PERSISTENT = "Persistent";
151     final static String JavaDoc DELIVERY_MODE_NONPERSISTENT = "Nonpersistent";
152     final static String JavaDoc DELIVERY_MODE_DISCARDABLE = "Discardable";
153     final static int DEFAULT_DELIVERY_MODE = DeliveryMode.NON_PERSISTENT;
154
155     final static int DEFAULT_PRIORITY = Message.DEFAULT_PRIORITY;
156     final static long DEFAULT_TIME_TO_LIVE = Message.DEFAULT_TIME_TO_LIVE;
157
158     /**
159      * Key for properties used in the <code>registerListener</code>
160      * method. It is valid for either domain.
161      * The value must be a <code>java.lang.String</code>.
162      * See the javax.jms javadoc for information on this property.
163      */

164     final static String JavaDoc MESSAGE_SELECTOR = JMS_PROPERTY_PREFIX + _MESSAGE_SELECTOR;
165     /**
166      * Key for properties used in the <code>registerListener</code>
167      * method. It is valid for either domain.
168      * The value must be a <code>java.lang.Integer</code> that is one of
169      * Session.AUTO_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE,
170      * or Session.CLIENT_ACKNOWLEDGE.
171      * See the javax.jms javadoc for information on this property.
172      */

173     final static String JavaDoc ACKNOWLEDGE_MODE = JMS_PROPERTY_PREFIX + _ACKNOWLEDGE_MODE;
174
175     /**
176      * value for ACKNOWLEDGE_MODE if left unset. It is equal to
177      * Session.DUPS_OK_ACKNOWLEDGE.
178      */

179     final static int DEFAULT_ACKNOWLEDGE_MODE = Session.DUPS_OK_ACKNOWLEDGE;
180
181     /**
182      * Specifies the name of a durable subscription
183      * Key for properties used in the <code>registerListener</code>
184      * method. It is valid for the PubSub domain.
185      * The value must be a <code>java.lang.String</code>.
186      */

187     final static String JavaDoc SUBSCRIPTION_NAME = JMS_PROPERTY_PREFIX + _SUBSCRIPTION_NAME;
188     /**
189      * Key for properties used in the <code>registerListener</code>
190      * method. It is valid for the PubSub domain.
191      * Specifies that the durable subscription should be unsubscribed
192      * (deleted from the broker) when unregistered.
193      * The value must be a <code>java.lang.Boolean</code>.
194      */

195     final static String JavaDoc UNSUBSCRIBE = JMS_PROPERTY_PREFIX + _UNSUBSCRIBE;
196     /**
197      * Key for properties used in the <code>registerListener</code>
198      * method. It is valid for the PubSub domain.
199      * The value must be a <code>java.lang.Boolean</code>.
200      */

201     final static String JavaDoc NO_LOCAL = JMS_PROPERTY_PREFIX + _NO_LOCAL;
202
203     final static boolean DEFAULT_NO_LOCAL = false;
204     final static boolean DEFAULT_UNSUBSCRIBE = false;
205
206     /**
207      * Key for properties used in the <code>createConnector</code>
208      * method. It changes the behavior of the wsclient.
209      * The value must be a <code>java.lang.Integer</code>.
210      */

211     final static String JavaDoc NUM_RETRIES = JMS_PROPERTY_PREFIX + _NUM_RETRIES;
212     /**
213      * Key for properties used in the <code>createConnector</code>
214      * method. It changes the behavior of the wsclient.
215      * The value must be a <code>java.lang.Integer</code>.
216      */

217     final static String JavaDoc NUM_SESSIONS = JMS_PROPERTY_PREFIX + _NUM_SESSIONS;
218     /**
219      * Key for properties used in the <code>createConnector</code>
220      * method. It changes the behavior of the wsclient.
221      * The value must be a <code>java.lang.Long</code>.
222      */

223     final static String JavaDoc CONNECT_RETRY_INTERVAL = JMS_PROPERTY_PREFIX + _CONNECT_RETRY_INTERVAL;
224     /**
225      * Key for properties used in the <code>createConnector</code>
226      * method. It changes the behavior of the wsclient.
227      * The value must be a <code>java.lang.Long</code>.
228      */

229     final static String JavaDoc INTERACT_RETRY_INTERVAL = JMS_PROPERTY_PREFIX + _INTERACT_RETRY_INTERVAL;
230     /**
231      * Key for properties used in the <code>createConnector</code>
232      * method. It changes the behavior of the wsclient.
233      * The value must be a <code>java.lang.Long</code>.
234      */

235     final static String JavaDoc TIMEOUT_TIME = JMS_PROPERTY_PREFIX + _TIMEOUT_TIME;
236     /**
237      * Key for properties used in the <code>createConnector</code>
238      * method. It changes the behavior of the wsclient.
239      * The value must be a <code>java.lang.Long</code>.
240      */

241     final static String JavaDoc MIN_TIMEOUT_TIME = JMS_PROPERTY_PREFIX + _MIN_TIMEOUT_TIME;
242
243     final static int DEFAULT_NUM_RETRIES = 5;
244     final static int DEFAULT_NUM_SESSIONS = 5;
245
246     final static long DEFAULT_CONNECT_RETRY_INTERVAL = 2000;
247     final static long DEFAULT_TIMEOUT_TIME = 5000;
248     final static long DEFAULT_MIN_TIMEOUT_TIME = 1000;
249     final static long DEFAULT_INTERACT_RETRY_INTERVAL = 250;
250
251     // key used to store the JMS connector in the message context
252
final static String JavaDoc CONNECTOR = JMS_PROPERTY_PREFIX + "Connector";
253
254     // key used to store the JMS vendor adapter in the message context
255
final static String JavaDoc VENDOR_ADAPTER = JMS_PROPERTY_PREFIX + "VendorAdapter";
256
257     // key used to store the JMS URL string in the message context
258
final static String JavaDoc JMS_URL = JMS_PROPERTY_PREFIX + "EndpointAddress";
259     
260     /** A property that carries a Map of application-specific properties to be
261      * added to the JMS messages when issued.
262      */

263     final static String JavaDoc JMS_APPLICATION_MSG_PROPS =
264         JMS_PROPERTY_PREFIX + "msgProps";
265
266     final static String JavaDoc ADAPTER_POSTFIX = "VendorAdapter";
267 }
Popular Tags