001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019 020 // 021 // This source code implements specifications defined by the Java 022 // Community Process. In order to remain compliant with the specification 023 // DO NOT add / change / or delete method signatures! 024 // 025 026 package javax.jms; 027 028 import java.io.Serializable; 029 030 /** 031 * @version $Rev: 467553 $ $Date: 2006-10-25 05:01:51 +0100 (Wed, 25 Oct 2006) $ 032 */ 033 public interface Session extends Runnable { 034 static final int AUTO_ACKNOWLEDGE = 1; 035 036 static final int CLIENT_ACKNOWLEDGE = 2; 037 038 static final int DUPS_OK_ACKNOWLEDGE = 3; 039 040 static final int SESSION_TRANSACTED = 0; 041 042 BytesMessage createBytesMessage() throws JMSException; 043 044 MapMessage createMapMessage() throws JMSException; 045 046 Message createMessage() throws JMSException; 047 048 ObjectMessage createObjectMessage() throws JMSException; 049 050 ObjectMessage createObjectMessage(Serializable object) throws JMSException; 051 052 StreamMessage createStreamMessage() throws JMSException; 053 054 TextMessage createTextMessage() throws JMSException; 055 056 TextMessage createTextMessage(String text) throws JMSException; 057 058 boolean getTransacted() throws JMSException; 059 060 int getAcknowledgeMode() throws JMSException; 061 062 void commit() throws JMSException; 063 064 void rollback() throws JMSException; 065 066 void close() throws JMSException; 067 068 void recover() throws JMSException; 069 070 MessageListener getMessageListener() throws JMSException; 071 072 void setMessageListener(MessageListener listener) throws JMSException; 073 074 public void run(); 075 076 MessageProducer createProducer(Destination destination) 077 throws JMSException; 078 079 MessageConsumer createConsumer(Destination destination) 080 throws JMSException; 081 082 MessageConsumer createConsumer( 083 Destination destination, 084 java.lang.String messageSelector) 085 throws JMSException; 086 087 MessageConsumer createConsumer( 088 Destination destination, 089 java.lang.String messageSelector, 090 boolean NoLocal) 091 throws JMSException; 092 093 Queue createQueue(String queueName) throws JMSException; 094 095 Topic createTopic(String topicName) throws JMSException; 096 097 TopicSubscriber createDurableSubscriber(Topic topic, String name) 098 throws JMSException; 099 100 TopicSubscriber createDurableSubscriber( 101 Topic topic, 102 String name, 103 String messageSelector, 104 boolean noLocal) 105 throws JMSException; 106 107 QueueBrowser createBrowser(Queue queue) throws JMSException; 108 109 QueueBrowser createBrowser(Queue queue, String messageSelector) 110 throws JMSException; 111 112 TemporaryQueue createTemporaryQueue() throws JMSException; 113 114 TemporaryTopic createTemporaryTopic() throws JMSException; 115 116 void unsubscribe(String name) throws JMSException; 117 }