KickJava   Java API By Example, From Geeks To Geeks.

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


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.management.ObjectName JavaDoc;
21
22 import org.apache.activemq.Service;
23
24 public interface BrokerViewMBean extends Service {
25
26     /**
27      * @return The unique id of the broker.
28      */

29     public abstract String JavaDoc getBrokerId();
30
31     /**
32      * The Broker will fush it's caches so that the garbage
33      * collector can recalaim more memory.
34      *
35      * @throws Exception
36      */

37     public void gc() throws Exception JavaDoc;
38     
39     
40     public void resetStatistics();
41     
42     public void enableStatistics();
43     public void disableStatistics();
44     public boolean isStatisticsEnabled();
45     
46     public long getTotalEnqueueCount();
47     public long getTotalDequeueCount();
48     public long getTotalConsumerCount();
49     public long getTotalMessageCount();
50     
51     public int getMemoryPercentageUsed();
52     public long getMemoryLimit();
53     public void setMemoryLimit(long limit);
54
55     /**
56      * Shuts down the JVM.
57      * @param exitCode the exit code that will be reported by the JVM process when it exits.
58      */

59     public void terminateJVM(int exitCode);
60     
61     /**
62      * Stop the broker and all it's components.
63      */

64     public void stop() throws Exception JavaDoc;
65     
66     public ObjectName JavaDoc[] getTopics();
67     public ObjectName JavaDoc[] getQueues();
68     public ObjectName JavaDoc[] getTemporaryTopics();
69     public ObjectName JavaDoc[] getTemporaryQueues();
70     
71     public ObjectName JavaDoc[] getTopicSubscribers();
72     public ObjectName JavaDoc[] getDurableTopicSubscribers();
73     public ObjectName JavaDoc[] getInactiveDurableTopicSubscribers();
74     public ObjectName JavaDoc[] getQueueSubscribers();
75     public ObjectName JavaDoc[] getTemporaryTopicSubscribers();
76     public ObjectName JavaDoc[] getTemporaryQueueSubscribers();
77     
78     /**
79      * Adds a Topic destination to the broker.
80      * @param name The name of the Topic
81      * @throws Exception
82      */

83     public void addTopic(String JavaDoc name) throws Exception JavaDoc;
84
85     /**
86      * Adds a Queue destination to the broker.
87      * @param name The name of the Queue
88      * @throws Exception
89      */

90     public void addQueue(String JavaDoc name) throws Exception JavaDoc;
91
92     /**
93      * Removes a Topic destination from the broker.
94      * @param name The name of the Topic
95      * @throws Exception
96      */

97     public void removeTopic(String JavaDoc name) throws Exception JavaDoc;
98
99     /**
100      * Removes a Queue destination from the broker.
101      * @param name The name of the Queue
102      * @throws Exception
103      */

104     public void removeQueue(String JavaDoc name) throws Exception JavaDoc;
105
106     /**
107      * Creates a new durable topic subscriber
108      *
109      * @param clientId the JMS client ID
110      * @param subscriberName the durable subscriber name
111      * @param topicName the name of the topic to subscribe to
112      * @param selector a selector or null
113      *
114      * @return the object name of the MBean registered in JMX
115      */

116     public ObjectName JavaDoc createDurableSubscriber(String JavaDoc clientId, String JavaDoc subscriberName, String JavaDoc topicName, String JavaDoc selector) throws Exception JavaDoc;
117
118     /**
119      * Destroys a durable subscriber
120      *
121      * @param clientId the JMS client ID
122      * @param subscriberName the durable subscriber name
123      */

124     public void destroyDurableSubscriber(String JavaDoc clientId, String JavaDoc subscriberName) throws Exception JavaDoc;
125     
126 }
127
Popular Tags