View Javadoc

1   /**
2    *
3    * Copyright 2003-2004 The Apache Software Foundation
4    *
5    *  Licensed under the Apache License, Version 2.0 (the "License");
6    *  you may not use this file except in compliance with the License.
7    *  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   *  Unless required by applicable law or agreed to in writing, software
12   *  distributed under the License is distributed on an "AS IS" BASIS,
13   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   *  See the License for the specific language governing permissions and
15   *  limitations under the License.
16   */
17  
18  //
19  // This source code implements specifications defined by the Java
20  // Community Process. In order to remain compliant with the specification
21  // DO NOT add / change / or delete method signatures!
22  //
23  
24  package javax.jms;
25  
26  import java.io.Serializable;
27  
28  /**
29   * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
30   */
31  public interface Session extends Runnable {
32      static final int AUTO_ACKNOWLEDGE = 1;
33  
34      static final int CLIENT_ACKNOWLEDGE = 2;
35  
36      static final int DUPS_OK_ACKNOWLEDGE = 3;
37  
38      static final int SESSION_TRANSACTED = 0;
39  
40      BytesMessage createBytesMessage() throws JMSException;
41  
42      MapMessage createMapMessage() throws JMSException;
43  
44      Message createMessage() throws JMSException;
45  
46      ObjectMessage createObjectMessage() throws JMSException;
47  
48      ObjectMessage createObjectMessage(Serializable object) throws JMSException;
49  
50      StreamMessage createStreamMessage() throws JMSException;
51  
52      TextMessage createTextMessage() throws JMSException;
53  
54      TextMessage createTextMessage(String text) throws JMSException;
55  
56      boolean getTransacted() throws JMSException;
57  
58      int getAcknowledgeMode() throws JMSException;
59  
60      void commit() throws JMSException;
61  
62      void rollback() throws JMSException;
63  
64      void close() throws JMSException;
65  
66      void recover() throws JMSException;
67  
68      MessageListener getMessageListener() throws JMSException;
69  
70      void setMessageListener(MessageListener listener) throws JMSException;
71  
72      public void run();
73  
74      MessageProducer createProducer(Destination destination)
75          throws JMSException;
76  
77      MessageConsumer createConsumer(Destination destination)
78          throws JMSException;
79  
80      MessageConsumer createConsumer(
81          Destination destination,
82          java.lang.String messageSelector)
83          throws JMSException;
84  
85      MessageConsumer createConsumer(
86          Destination destination,
87          java.lang.String messageSelector,
88          boolean NoLocal)
89          throws JMSException;
90  
91      Queue createQueue(String queueName) throws JMSException;
92  
93      Topic createTopic(String topicName) throws JMSException;
94  
95      TopicSubscriber createDurableSubscriber(Topic topic, String name)
96          throws JMSException;
97  
98      TopicSubscriber createDurableSubscriber(
99          Topic topic,
100         String name,
101         String messageSelector,
102         boolean noLocal)
103         throws JMSException;
104 
105     QueueBrowser createBrowser(Queue queue) throws JMSException;
106 
107     QueueBrowser createBrowser(Queue queue, String messageSelector)
108         throws JMSException;
109 
110     TemporaryQueue createTemporaryQueue() throws JMSException;
111 
112     TemporaryTopic createTemporaryTopic() throws JMSException;
113 
114     void unsubscribe(String name) throws JMSException;
115 }