001 /**
002 *
003 * Copyright 2003-2004 The Apache Software Foundation
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 //
019 // This source code implements specifications defined by the Java
020 // Community Process. In order to remain compliant with the specification
021 // DO NOT add / change / or delete method signatures!
022 //
023
024 package javax.jms;
025
026 import java.io.Serializable;
027
028 /**
029 * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
030 */
031 public interface Session extends Runnable {
032 static final int AUTO_ACKNOWLEDGE = 1;
033
034 static final int CLIENT_ACKNOWLEDGE = 2;
035
036 static final int DUPS_OK_ACKNOWLEDGE = 3;
037
038 static final int SESSION_TRANSACTED = 0;
039
040 BytesMessage createBytesMessage() throws JMSException;
041
042 MapMessage createMapMessage() throws JMSException;
043
044 Message createMessage() throws JMSException;
045
046 ObjectMessage createObjectMessage() throws JMSException;
047
048 ObjectMessage createObjectMessage(Serializable object) throws JMSException;
049
050 StreamMessage createStreamMessage() throws JMSException;
051
052 TextMessage createTextMessage() throws JMSException;
053
054 TextMessage createTextMessage(String text) throws JMSException;
055
056 boolean getTransacted() throws JMSException;
057
058 int getAcknowledgeMode() throws JMSException;
059
060 void commit() throws JMSException;
061
062 void rollback() throws JMSException;
063
064 void close() throws JMSException;
065
066 void recover() throws JMSException;
067
068 MessageListener getMessageListener() throws JMSException;
069
070 void setMessageListener(MessageListener listener) throws JMSException;
071
072 public void run();
073
074 MessageProducer createProducer(Destination destination)
075 throws JMSException;
076
077 MessageConsumer createConsumer(Destination destination)
078 throws JMSException;
079
080 MessageConsumer createConsumer(
081 Destination destination,
082 java.lang.String messageSelector)
083 throws JMSException;
084
085 MessageConsumer createConsumer(
086 Destination destination,
087 java.lang.String messageSelector,
088 boolean NoLocal)
089 throws JMSException;
090
091 Queue createQueue(String queueName) throws JMSException;
092
093 Topic createTopic(String topicName) throws JMSException;
094
095 TopicSubscriber createDurableSubscriber(Topic topic, String name)
096 throws JMSException;
097
098 TopicSubscriber createDurableSubscriber(
099 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 }