Package org.apache.activemq.broker.jmx
Class ConnectionView
- java.lang.Object
-
- org.apache.activemq.broker.jmx.ConnectionView
-
- All Implemented Interfaces:
ConnectionViewMBean,Service
public class ConnectionView extends Object implements ConnectionViewMBean
-
-
Constructor Summary
Constructors Constructor Description ConnectionView(Connection connection)ConnectionView(Connection connection, ManagementContext managementContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetActiveTransactionCount()Returns the number of active transactions established on this Connection.StringgetClientId()Returns the client identifier for this connectionStringgetConnectionId()ObjectName[]getConsumers()Returns the ObjectNames of all the Consumers created by this Connection.intgetDispatchQueueSize()Returns the number of messages to be dispatched to this connectionLonggetOldestActiveTransactionDuration()Returns the number of active transactions established on this Connection.ObjectName[]getProducers()Returns the ObjectNames of all the Producers created by this Connection.StringgetRemoteAddress()Returns the source address for this connectionStringgetUserName()Returns the User Name used to authorize creation of this Connection.booleanisActive()booleanisBlocked()booleanisConnected()booleanisSlow()voidresetStatistics()Resets the statisticsvoidsetUserName(String userName)voidstart()voidstop()
-
-
-
Constructor Detail
-
ConnectionView
public ConnectionView(Connection connection)
-
ConnectionView
public ConnectionView(Connection connection, ManagementContext managementContext)
-
-
Method Detail
-
start
public void start() throws Exception
-
isSlow
public boolean isSlow()
- Specified by:
isSlowin interfaceConnectionViewMBean- Returns:
- true if the Connection is slow
-
isBlocked
public boolean isBlocked()
- Specified by:
isBlockedin interfaceConnectionViewMBean- Returns:
- if after being marked, the Connection is still writing
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceConnectionViewMBean- Returns:
- true if the Connection is connected
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceConnectionViewMBean- Returns:
- true if the Connection is active
-
getDispatchQueueSize
public int getDispatchQueueSize()
Description copied from interface:ConnectionViewMBeanReturns the number of messages to be dispatched to this connection- Specified by:
getDispatchQueueSizein interfaceConnectionViewMBean- Returns:
- the number of messages pending dispatch
-
resetStatistics
public void resetStatistics()
Resets the statistics- Specified by:
resetStatisticsin interfaceConnectionViewMBean
-
getRemoteAddress
public String getRemoteAddress()
Description copied from interface:ConnectionViewMBeanReturns the source address for this connection- Specified by:
getRemoteAddressin interfaceConnectionViewMBean- Returns:
- the source address for this connection
-
getClientId
public String getClientId()
Description copied from interface:ConnectionViewMBeanReturns the client identifier for this connection- Specified by:
getClientIdin interfaceConnectionViewMBean- Returns:
- the the client identifier for this connection
-
getConnectionId
public String getConnectionId()
-
getUserName
public String getUserName()
Description copied from interface:ConnectionViewMBeanReturns the User Name used to authorize creation of this Connection. This value can be null if display of user name information is disabled.- Specified by:
getUserNamein interfaceConnectionViewMBean- Returns:
- the name of the user that created this Connection
-
setUserName
public void setUserName(String userName)
-
getConsumers
public ObjectName[] getConsumers()
Description copied from interface:ConnectionViewMBeanReturns the ObjectNames of all the Consumers created by this Connection.- Specified by:
getConsumersin interfaceConnectionViewMBean- Returns:
- the ObjectNames of all Consumers created by this Connection.
-
getProducers
public ObjectName[] getProducers()
Description copied from interface:ConnectionViewMBeanReturns the ObjectNames of all the Producers created by this Connection.- Specified by:
getProducersin interfaceConnectionViewMBean- Returns:
- the ObjectNames of all Producers created by this Connection.
-
getActiveTransactionCount
public int getActiveTransactionCount()
Description copied from interface:ConnectionViewMBeanReturns the number of active transactions established on this Connection.- Specified by:
getActiveTransactionCountin interfaceConnectionViewMBean- Returns:
- the number of active transactions established on this Connection..
-
getOldestActiveTransactionDuration
public Long getOldestActiveTransactionDuration()
Description copied from interface:ConnectionViewMBeanReturns the number of active transactions established on this Connection.- Specified by:
getOldestActiveTransactionDurationin interfaceConnectionViewMBean- Returns:
- the number of active transactions established on this Connection..
-
-