001 /** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 package org.apache.activemq.broker.jmx; 018 019 import javax.management.ObjectName; 020 021 import org.apache.activemq.Service; 022 023 public interface ConnectionViewMBean extends Service { 024 /** 025 * @return true if the Connection is slow 026 */ 027 @MBeanInfo("Connection is slow.") 028 boolean isSlow(); 029 030 /** 031 * @return if after being marked, the Connection is still writing 032 */ 033 @MBeanInfo("Connection is blocked.") 034 boolean isBlocked(); 035 036 /** 037 * @return true if the Connection is connected 038 */ 039 @MBeanInfo("Connection is connected to the broker.") 040 boolean isConnected(); 041 042 /** 043 * @return true if the Connection is active 044 */ 045 @MBeanInfo("Connection is active (both connected and receiving messages).") 046 boolean isActive(); 047 048 /** 049 * Resets the statistics 050 */ 051 @MBeanInfo("Resets the statistics") 052 void resetStatistics(); 053 054 /** 055 * Returns the source address for this connection 056 * 057 * @return the source address for this connection 058 */ 059 @MBeanInfo("Source address for this connection") 060 String getRemoteAddress(); 061 062 /** 063 * Returns the number of messages to be dispatched to this connection 064 * @return the number of messages pending dispatch 065 */ 066 @MBeanInfo("The number of messages pending dispatch") 067 public int getDispatchQueueSize(); 068 069 /** 070 * Returns the User Name used to authorize creation of this Connection. 071 * This value can be null if display of user name information is disabled. 072 * 073 * @return the name of the user that created this Connection 074 */ 075 @MBeanInfo("User Name used to authorize creation of this connection") 076 String getUserName(); 077 078 /** 079 * Returns the ObjectNames of all the Consumers created by this Connection. 080 * 081 * @return the ObjectNames of all Consumers created by this Connection. 082 */ 083 @MBeanInfo("The ObjectNames of all Consumers created by this Connection") 084 ObjectName[] getConsumers(); 085 086 /** 087 * Returns the ObjectNames of all the Producers created by this Connection. 088 * 089 * @return the ObjectNames of all Producers created by this Connection. 090 */ 091 @MBeanInfo("The ObjectNames of all Producers created by this Connection") 092 ObjectName[] getProducers(); 093 094 }