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.bluestemsoftware.specification.eoa.ext.ExtensionFactoryContext;
 
 public class Connection implements ConnectionMBean {
 
     private ConnectionViewMBean underlying;
     private ExtensionFactoryContext factoryContext;
 
     public Connection(ExtensionFactoryContext factoryContextConnectionViewMBean underlying) {
         this. = factoryContext;
         this. = underlying;
     }
 
     public String getConnectionId() {
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             return .getConnectionId();
 
         } finally {
             thread.setContextClassLoader(cl);
         }
     }
 
     public long getDequeueCount() {
 
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             return .getDequeueCount();
         } finally {
             thread.setContextClassLoader(cl);
         }
     }
 
     public int getDispatchQueueSize() {
 
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             return .getDispatchQueueSize();
         } finally {
             thread.setContextClassLoader(cl);
         }
     }
 
     public long getEnqueueCount() {
 
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             return .getEnqueueCount();
         } finally {
             thread.setContextClassLoader(cl);
         }
     }
 
     public String getRemoteAddress() {
 
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             return .getRemoteAddress();
         } finally {
             thread.setContextClassLoader(cl);
         }
     }
 
     public boolean isActive() {
 
         Thread thread = Thread.currentThread();
         ClassLoader cl = thread.getContextClassLoader();
         try {
             thread.setContextClassLoader(.getClassLoader());
             return .isActive();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public boolean isBlocked() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .isBlocked();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public boolean isConnected() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .isConnected();
        } finally {
            thread.setContextClassLoader(cl);
        }
    }
    public boolean isSlow() {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            return .isSlow();
        } 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 start() throws Exception {
        Thread thread = Thread.currentThread();
        ClassLoader cl = thread.getContextClassLoader();
        try {
            thread.setContextClassLoader(.getClassLoader());
            .start();
        } 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);
        }
    }
New to GrepCode? Check out our FAQ X