KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > broker > jmx > DestinationViewMBean


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.activemq.broker.jmx;
19
20 import javax.jms.InvalidSelectorException JavaDoc;
21 import javax.management.openmbean.CompositeData JavaDoc;
22 import javax.management.openmbean.OpenDataException JavaDoc;
23 import javax.management.openmbean.TabularData JavaDoc;
24
25 import java.util.List JavaDoc;
26 import java.util.Map JavaDoc;
27
28
29 public interface DestinationViewMBean {
30     
31     /**
32      * Returns the name of this destination
33      */

34     public String JavaDoc getName();
35     
36     /**
37      * Resets the managment counters.
38      */

39     public void resetStatistics();
40
41     /**
42      * Returns the number of messages that have been sent to the destination.
43      *
44      * @return The number of messages that have been sent to the destination.
45      */

46     public long getEnqueueCount();
47     
48     /**
49      * Returns the number of messages that have been delivered (potentially not acknowledged) to consumers.
50      *
51      * @return The number of messages that have been delivered (potentially not acknowledged) to consumers.
52      */

53     public long getDispatchCount();
54     
55     /**
56      * Returns the number of messages that have been acknowledged from the destination.
57      *
58      * @return The number of messages that have been acknowledged from the destination.
59      */

60     public long getDequeueCount();
61
62     /**
63      * Returns the number of consumers subscribed this destination.
64      *
65      * @return The number of consumers subscribed this destination.
66      */

67     public long getConsumerCount();
68
69     /**
70      * Returns the number of messages in this destination which are yet to be consumed
71      *
72      * @return Returns the number of messages in this destination which are yet to be consumed
73      */

74     public long getQueueSize();
75     
76     /**
77      * @return An array of all the messages in the destination's queue.
78      */

79     public CompositeData JavaDoc[] browse() throws OpenDataException JavaDoc;
80     
81     /**
82      * @return A list of all the messages in the destination's queue.
83      */

84     public TabularData JavaDoc browseAsTable() throws OpenDataException JavaDoc;
85
86     /**
87      * @return An array of all the messages in the destination's queue.
88      * @throws InvalidSelectorException
89      */

90     public CompositeData JavaDoc[] browse(String JavaDoc selector) throws OpenDataException JavaDoc, InvalidSelectorException JavaDoc;
91     
92     /**
93      * @return A list of all the messages in the destination's queue.
94      * @throws InvalidSelectorException
95      */

96     public TabularData JavaDoc browseAsTable(String JavaDoc selector) throws OpenDataException JavaDoc, InvalidSelectorException JavaDoc;
97
98     /**
99      * Sends a TextMesage to the destination.
100      * @param body the text to send
101      * @return the message id of the message sent.
102      * @throws Exception
103      */

104     public String JavaDoc sendTextMessage(String JavaDoc body) throws Exception JavaDoc;
105
106     /**
107      * Sends a TextMesage to the destination.
108      * @param headers the message headers and properties to set. Can only container Strings maped to primitive types.
109      * @param body the text to send
110      * @return the message id of the message sent.
111      * @throws Exception
112      */

113     public String JavaDoc sendTextMessage(Map JavaDoc headers, String JavaDoc body) throws Exception JavaDoc;
114
115     public int getMemoryPercentageUsed();
116     public long getMemoryLimit();
117     public void setMemoryLimit(long limit);
118
119     /**
120      * Browses the current destination returning a list of messages
121      */

122     public List JavaDoc browseMessages() throws InvalidSelectorException JavaDoc;
123
124     /**
125      * Browses the current destination with the given selector returning a list of messages
126      */

127     public List JavaDoc browseMessages(String JavaDoc selector) throws InvalidSelectorException JavaDoc;
128
129 }
130
Popular Tags