ManagedChannel.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 
22 package org.apache.qpid.server;
23 
24 import java.io.IOException;
25 
26 import javax.management.JMException;
27 
28 /**
29  * The managed interface exposed to allow management of channels.
30  @author   Bhupendra Bhardwaj
31  @version  0.1
32  */
33 public interface ManagedChannel
34 {
35     static final String TYPE = "Channel";
36 
37     /**
38      * Tells whether the channel is transactional.
39      @return true if the channel is transactional.
40      @throws IOException
41      */
42     boolean isTransactional() throws IOException;
43 
44     /**
45      * Tells the number of unacknowledged messages in this channel.
46      @return number of unacknowledged messages.
47      @throws IOException
48      */
49     int getUnacknowledgedMessageCount() throws IOException;
50 
51     
52     //********** Operations *****************//
53 
54     /**
55      * Commits the transactions if the channel is transactional.
56      @throws IOException
57      @throws JMException
58      */
59     void commitTransactions() throws IOException, JMException;
60 
61     /**
62      * Rollsback the transactions if the channel is transactional.
63      @throws IOException
64      @throws JMException
65      */
66     void rollbackTransactions() throws IOException, JMException;
67 
68 }