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 int
getActiveTransactionCount()
Returns the number of active transactions established on this Connection.String
getClientId()
Returns the client identifier for this connectionString
getConnectionId()
ObjectName[]
getConsumers()
Returns the ObjectNames of all the Consumers created by this Connection.int
getDispatchQueueSize()
Returns the number of messages to be dispatched to this connectionLong
getOldestActiveTransactionDuration()
Returns the number of active transactions established on this Connection.ObjectName[]
getProducers()
Returns the ObjectNames of all the Producers created by this Connection.String
getRemoteAddress()
Returns the source address for this connectionString
getUserName()
Returns the User Name used to authorize creation of this Connection.boolean
isActive()
boolean
isBlocked()
boolean
isConnected()
boolean
isSlow()
void
resetStatistics()
Resets the statisticsvoid
setUserName(String userName)
void
start()
void
stop()
-
-
-
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:
isSlow
in interfaceConnectionViewMBean
- Returns:
- true if the Connection is slow
-
isBlocked
public boolean isBlocked()
- Specified by:
isBlocked
in interfaceConnectionViewMBean
- Returns:
- if after being marked, the Connection is still writing
-
isConnected
public boolean isConnected()
- Specified by:
isConnected
in interfaceConnectionViewMBean
- Returns:
- true if the Connection is connected
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceConnectionViewMBean
- Returns:
- true if the Connection is active
-
getDispatchQueueSize
public int getDispatchQueueSize()
Description copied from interface:ConnectionViewMBean
Returns the number of messages to be dispatched to this connection- Specified by:
getDispatchQueueSize
in interfaceConnectionViewMBean
- Returns:
- the number of messages pending dispatch
-
resetStatistics
public void resetStatistics()
Resets the statistics- Specified by:
resetStatistics
in interfaceConnectionViewMBean
-
getRemoteAddress
public String getRemoteAddress()
Description copied from interface:ConnectionViewMBean
Returns the source address for this connection- Specified by:
getRemoteAddress
in interfaceConnectionViewMBean
- Returns:
- the source address for this connection
-
getClientId
public String getClientId()
Description copied from interface:ConnectionViewMBean
Returns the client identifier for this connection- Specified by:
getClientId
in interfaceConnectionViewMBean
- Returns:
- the the client identifier for this connection
-
getConnectionId
public String getConnectionId()
-
getUserName
public String getUserName()
Description copied from interface:ConnectionViewMBean
Returns 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:
getUserName
in 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:ConnectionViewMBean
Returns the ObjectNames of all the Consumers created by this Connection.- Specified by:
getConsumers
in interfaceConnectionViewMBean
- Returns:
- the ObjectNames of all Consumers created by this Connection.
-
getProducers
public ObjectName[] getProducers()
Description copied from interface:ConnectionViewMBean
Returns the ObjectNames of all the Producers created by this Connection.- Specified by:
getProducers
in interfaceConnectionViewMBean
- Returns:
- the ObjectNames of all Producers created by this Connection.
-
getActiveTransactionCount
public int getActiveTransactionCount()
Description copied from interface:ConnectionViewMBean
Returns the number of active transactions established on this Connection.- Specified by:
getActiveTransactionCount
in interfaceConnectionViewMBean
- Returns:
- the number of active transactions established on this Connection..
-
getOldestActiveTransactionDuration
public Long getOldestActiveTransactionDuration()
Description copied from interface:ConnectionViewMBean
Returns the number of active transactions established on this Connection.- Specified by:
getOldestActiveTransactionDuration
in interfaceConnectionViewMBean
- Returns:
- the number of active transactions established on this Connection..
-
-