Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2008 Bluestem Software LLC. All Rights Reserved. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 
 package org.bluestemsoftware.open.eoa.ext.feature.jms.server.activemq.mgmt.jmx;
 
 
 import  org.apache.activemq.broker.jmx.BrokerViewMBean;
 
 public class Broker implements BrokerMBean {
 
     private BrokerViewMBean underlying;
 
     public Broker(ExtensionFactoryContext factoryContext, BrokerViewMBean underlying) {
         this. = factoryContext;
         this. = underlying;
     }
 
     public void addQueue(String namethrows Exception {
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             .addQueue(name);
         } finally {
             thread.setContextClassLoader(cl);
         }
     }
 
     public void addTopic(String namethrows Exception {
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             .addTopic(name);
         } finally {
             thread.setContextClassLoader(cl);
         }
     }
 
     public ObjectName createDurableSubscriber(String clientIdString subscriberNameString topicNameString selectorthrows Exception {
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             return .createDurableSubscriber(clientIdsubscriberNametopicNameselector);
         } finally {
             thread.setContextClassLoader(cl);
         }
 
     }
 
     public void destroyDurableSubscriber(String clientIdString subscriberNamethrows Exception {
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             .destroyDurableSubscriber(clientIdsubscriberName);
         } finally {
             thread.setContextClassLoader(cl);
         }
 
     }
 
     public void gc() throws Exception {
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             .gc();
         } finally {
             thread.setContextClassLoader(cl);
         }
 
     }
 
     public String getBrokerId() {
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             return .getBrokerId();
         } finally {
            thread.setContextClassLoader(cl);
        }
    }
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getDurableTopicSubscribers();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getInactiveDurableTopicSubscribers();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public long getMemoryLimit() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getMemoryLimit();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public ObjectName[] getQueueSubscribers() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getQueueSubscribers();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public ObjectName[] getQueues() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getQueues();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTemporaryQueueSubscribers();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public ObjectName[] getTemporaryQueues() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTemporaryQueues();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTemporaryTopicSubscribers();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public ObjectName[] getTemporaryTopics() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTemporaryTopics();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public ObjectName[] getTopicSubscribers() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTopicSubscribers();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public ObjectName[] getTopics() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTopics();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public long getTotalConsumerCount() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTotalConsumerCount();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public long getTotalDequeueCount() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTotalDequeueCount();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public long getTotalEnqueueCount() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTotalEnqueueCount();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public long getTotalMessageCount() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTotalMessageCount();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void removeQueue(String namethrows Exception {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .removeQueue(name);
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void removeTopic(String namethrows Exception {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .removeTopic(name);
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void resetStatistics() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .resetStatistics();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void setMemoryLimit(long limit) {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .setMemoryLimit(limit);
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void stop() throws Exception {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .stop();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void terminateJVM(int exitCode) {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .terminateJVM(exitCode);
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void start() throws Exception {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .start();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public String addConnector(String discoveryAddressthrows Exception {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .addConnector(discoveryAddress);
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public String addNetworkConnector(String discoveryAddressthrows Exception {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .addNetworkConnector(discoveryAddress);
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void disableStatistics() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .disableStatistics();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void enableStatistics() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .enableStatistics();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public String getBrokerName() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getBrokerName();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public int getMemoryPercentUsage() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getMemoryPercentUsage();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public long getStoreLimit() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getStoreLimit();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public int getStorePercentUsage() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getStorePercentUsage();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public long getTempLimit() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTempLimit();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public int getTempPercentUsage() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getTempPercentUsage();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public boolean isPersistent() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .isPersistent();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public boolean isSlave() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .isSlave();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public boolean isStatisticsEnabled() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .isStatisticsEnabled();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void reloadLog4jProperties() throws Throwable {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .reloadLog4jProperties();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public boolean removeConnector(String connectorNamethrows Exception {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .removeConnector(connectorName);
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public boolean removeNetworkConnector(String connectorNamethrows Exception {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .removeNetworkConnector(connectorName);
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void setStoreLimit(long limit) {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .setStoreLimit(limit);
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void setTempLimit(long limit) {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .setTempLimit(limit);
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public String getDataDirectory() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getDataDirectory();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public String getOpenWireURL() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getOpenWireURL();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public String getSslURL() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getSslURL();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public String getStompSslURL() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getStompSslURL();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public String getStompURL() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getStompURL();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public String getVMURL() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .getVMURL();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public void stopGracefully(String arg0String arg1long arg2long arg3throws Exception {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .stopGracefully(arg0arg1arg2arg3);
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
New to GrepCode? Check out our FAQ X