001 /*
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements. See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership. The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License. You may obtain a copy of the License at
010 *
011 * http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing,
014 * software distributed under the License is distributed on an
015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 * KIND, either express or implied. See the License for the
017 * specific language governing permissions and limitations
018 * under the License.
019 *
020 */
021 package org.apache.qpid.jms;
022
023 import org.apache.qpid.framing.AMQShortString;
024
025 import javax.jms.Destination;
026 import javax.jms.JMSException;
027 import javax.jms.MessageConsumer;
028 import javax.jms.MessageProducer;
029
030
031 public interface Session extends javax.jms.Session
032 {
033 /**
034 * Indicates that no client acknowledgements are required. Broker assumes that once it has delivered
035 * a message packet successfully it is acknowledged.
036 */
037 static final int NO_ACKNOWLEDGE = 257;
038
039 /**
040 * Pre acknowledge means that an ack is sent per message but sent before user code has processed
041 * the message (i.e. before the onMessage() call or the receive() method has returned).
042 */
043 static final int PRE_ACKNOWLEDGE = 258;
044
045 MessageConsumer createConsumer(Destination destination,
046 int prefetch,
047 boolean noLocal,
048 boolean exclusive,
049 String selector) throws JMSException;
050
051 MessageConsumer createConsumer(Destination destination,
052 int prefetchHigh,
053 int prefetchLow,
054 boolean noLocal,
055 boolean exclusive,
056 String selector) throws JMSException;
057
058 /**
059 * @return the prefetch value used by default for consumers created on this session.
060 */
061 int getDefaultPrefetch();
062
063 /**
064 * @return the High water prefetch value used by default for consumers created on this session.
065 */
066 int getDefaultPrefetchHigh();
067
068 /**
069 * @return the Low water prefetch value used by default for consumers created on this session.
070 */
071 int getDefaultPrefetchLow();
072
073 /**
074 * Create a producer
075 * @param destination
076 * @param mandatory the value of the mandatory flag used by default on the producer
077 * @param immediate the value of the immediate flag used by default on the producer
078 * @return
079 * @throws JMSException
080 */
081 MessageProducer createProducer(Destination destination, boolean mandatory, boolean immediate)
082 throws JMSException;
083
084 /**
085 * Create a producer
086 * @param destination
087 * @param immediate the value of the immediate flag used by default on the producer
088 * @return
089 * @throws JMSException
090 */
091 MessageProducer createProducer(Destination destination, boolean immediate)
092 throws JMSException;
093
094 AMQShortString getTemporaryTopicExchangeName();
095
096 AMQShortString getDefaultQueueExchangeName();
097
098 AMQShortString getDefaultTopicExchangeName();
099
100 AMQShortString getTemporaryQueueExchangeName();
101 }
|