final class JMSConnectorStatus extends Object implements JMSConnectorStatusMBean
Modifier and Type | Field and Description |
---|---|
(package private) ScheduledFuture<?> |
callableHandle |
private JMSConnectorCheck |
check |
(package private) JMSStatus |
jmsStatus
Root component
|
(package private) static org.objectweb.util.monolog.api.Logger |
logger |
private String |
mbeanName |
private int |
period
The period of time between 2 checks (in seconds).
|
Constructor and Description |
---|
JMSConnectorStatus(JMSStatus jmsStatus,
String cfname,
InitialContext ictx,
String user,
String pass,
String qname,
int period,
int timeOut)
Creates a JMS connectors healthcheck component.
|
Modifier and Type | Method and Description |
---|---|
String |
getErrorMsg()
Returns the error message of the last try.
|
String |
getLastConnectTime()
Returns the date of last successful connection.
|
long |
getLatencyConnect()
Returns the latency of the connection during the last try.
|
long |
getLatencyPubSub()
Returns the latency of the send/receive during the last try.
|
String |
getName() |
int |
getNbFailures()
Returns the total number of failures since starting.
|
int |
getNbTry()
Returns the total number of try since starting.
|
int |
getPeriod()
Returns the period of time between 2 checks.
|
int |
getStatus()
Returns the status of the connector: 0 => RUNNING, >0 => UNREACHABLE.
|
String |
getStatusInfo() |
int |
getTimeOut()
Returns the maximum time waiting for connection.
|
private void |
registerMBean() |
private void |
schedule() |
void |
setPeriod(int period)
Sets the period of time between 2 checks.
|
void |
setTimeOut(int timeOut)
Sets the maximum time waiting for connection.
|
(package private) void |
start() |
(package private) void |
stop() |
private void |
unregisterMBean() |
static org.objectweb.util.monolog.api.Logger logger
private JMSConnectorCheck check
private int period
JMSStatus jmsStatus
ScheduledFuture<?> callableHandle
private String mbeanName
JMSConnectorStatus(JMSStatus jmsStatus, String cfname, InitialContext ictx, String user, String pass, String qname, int period, int timeOut)
jmsStatus
- Root component.cfname
- JNDI name of the ConnectionFactory to use.ictx
- JNDI context allowing to get the ConnectionFactory.user
- User name for authentication, if null uses the ConnectioNfactory default.pass
- Password for authentication, if null uses the ConnectioNfactory default.qname
- Name of the queue used to check the JMS behavior. It is an internal not a JNDI name, this destination is created by the
module.period
- Period (in seconds) between 2 attempts of check.timeOut
- Maximum amount of time to wait either the connection or the message.public int getStatus()
JMSConnectorStatusMBean
getStatus
in interface JMSConnectorStatusMBean
public String getStatusInfo()
getStatusInfo
in interface JMSConnectorStatusMBean
public int getNbTry()
JMSConnectorStatusMBean
getNbTry
in interface JMSConnectorStatusMBean
public int getNbFailures()
JMSConnectorStatusMBean
getNbFailures
in interface JMSConnectorStatusMBean
public String getErrorMsg()
JMSConnectorStatusMBean
getErrorMsg
in interface JMSConnectorStatusMBean
public long getLatencyConnect()
JMSConnectorStatusMBean
getLatencyConnect
in interface JMSConnectorStatusMBean
public String getLastConnectTime()
JMSConnectorStatusMBean
getLastConnectTime
in interface JMSConnectorStatusMBean
public long getLatencyPubSub()
JMSConnectorStatusMBean
getLatencyPubSub
in interface JMSConnectorStatusMBean
public int getPeriod()
JMSConnectorStatusMBean
getPeriod
in interface JMSConnectorStatusMBean
public void setPeriod(int period)
JMSConnectorStatusMBean
setPeriod
in interface JMSConnectorStatusMBean
period
- the period of time between 2 checks.public int getTimeOut()
JMSConnectorStatusMBean
getTimeOut
in interface JMSConnectorStatusMBean
public void setTimeOut(int timeOut)
JMSConnectorStatusMBean
setTimeOut
in interface JMSConnectorStatusMBean
timeOut
- the maximum time waiting for connection.public String getName()
getName
in interface JMSConnectorStatusMBean
private void schedule()
void start()
void stop()
private void registerMBean()
private void unregisterMBean()
Copyright © 2021 ScalAgent D.T.. All rights reserved.