Connection.java
01 /*
02  *
03  * Licensed to the Apache Software Foundation (ASF) under one
04  * or more contributor license agreements.  See the NOTICE file
05  * distributed with this work for additional information
06  * regarding copyright ownership.  The ASF licenses this file
07  * to you under the Apache License, Version 2.0 (the
08  * "License"); you may not use this file except in compliance
09  * with the License.  You may obtain a copy of the License at
10  
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  */
21 package org.apache.qpid.jms;
22 
23 import javax.jms.JMSException;
24 
25 public interface Connection extends javax.jms.Connection
26 {
27     /**
28      @return the maximum number of sessions supported by this Connection
29      */
30     long getMaximumChannelCount() throws JMSException;
31 
32     void setConnectionListener(ConnectionListener listener);
33 
34     /**
35      * Get the connection listener that has been registered with this connection, if any
36      *
37      @return the listener or null if none has been set
38      */
39     ConnectionListener getConnectionListener();
40 
41     /**
42      * Create a session specifying the prefetch limit of messages.
43      *
44      @param transacted
45      @param acknowledgeMode
46      @param prefetch        the maximum number of messages to buffer in the client. This
47      *                        applies as a total across all consumers
48      @return
49      @throws JMSException
50      */
51     org.apache.qpid.jms.Session createSession(boolean transacted, int acknowledgeMode,
52                                               int prefetchthrows JMSException;
53 
54 
55     /**
56      * Create a session specifying the prefetch limit of messages.
57      *
58      @param transacted
59      @param acknowledgeMode
60      @param prefetchHigh    the maximum number of messages to buffer in the client.
61      *                        This applies as a total across all consumers
62      @param prefetchLow     the number of messages that must be in the buffer in the client to renable message flow.
63      *                        This applies as a total across all consumers
64      @return
65      @throws JMSException
66      */
67     org.apache.qpid.jms.Session createSession(boolean transacted, int acknowledgeMode,
68                                               int prefetchHigh, int prefetchLowthrows JMSException;
69 }