public final class JMSConnectorCheck extends Object
Modifier and Type | Field and Description |
---|---|
private ConnectionFactory |
cf |
private String |
cfname
JNDI Name of the ConnectionFactory to use.
|
private String |
errorMsg |
private int |
failures |
private InitialContext |
ictx |
(package private) static String[] |
info |
private String |
lastConnectTime |
private long |
latencyConnect |
private long |
latencyPubSub |
(package private) static Logger |
logger |
private int |
nbtry |
private String |
pass |
private String |
qname |
private Queue |
queue |
private int |
retryStatusCount
retryStatusCount == 0 => RUNNING, retryStatusCount > 0 => UNREACHABLE
|
static int |
RUNNING |
private int |
timeout
The maximum time waiting for connection.
|
static int |
UNREACHABLE |
private String |
user |
Constructor and Description |
---|
JMSConnectorCheck(ConnectionFactory cf,
String user,
String pass,
String qname,
int timeOut)
Creates a new component allowing to check a JMS connector.
|
JMSConnectorCheck(String cfname,
InitialContext ictx,
String user,
String pass,
String qname,
int timeOut)
Creates a new component allowing to check a JMS connector.
|
Modifier and Type | Method and Description |
---|---|
boolean |
check()
Checks the related JMS connector, creates a connection, then sends and receives a message.
|
String |
getCFName() |
private void |
getConnectionFactory() |
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.
|
int |
getNbFailures()
Returns the total number of failures since starting.
|
int |
getNbTry()
Returns the total number of try since starting.
|
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 |
setLatencyConnect(long latencyConnect) |
private void |
setLatencyPubSub(long latencyPubSub) |
private void |
setStatus(int retry) |
void |
setTimeOut(int timeOut)
Sets the maximum time waiting for connection.
|
String |
toString() |
static Logger logger
public static final int RUNNING
public static final int UNREACHABLE
static final String[] info
private int retryStatusCount
private int nbtry
private transient int failures
private String errorMsg
private String lastConnectTime
private long latencyConnect
private long latencyPubSub
private int timeout
private String cfname
private String user
private String pass
private String qname
private InitialContext ictx
private ConnectionFactory cf
private Queue queue
public JMSConnectorCheck(String cfname, InitialContext ictx, String user, String pass, String qname, int timeOut)
cfname
- JNDI name of the ConnectionFactory to use.ictx
- JNDI context allowing to retrieve ConnectionFactory.user
- User name for authentication, if no defined uses the ConnectionFactory default.pass
- Password for authentication, if no defined uses the ConnectionFactory default.qname
- Internal name of JMS destination.timeout
- Maximum amount of time to wait connecting and receiving messages, by default 10s.public JMSConnectorCheck(ConnectionFactory cf, String user, String pass, String qname, int timeOut)
cf
- ConnectionFactory to use.user
- User name for authentication, if no defined uses the ConnectionFactory default.pass
- Password for authentication, if no defined uses the ConnectionFactory default.qname
- Internal name of JMS destination.timeout
- Maximum amount of time to wait connecting and receiving messages, by default 10s.public int getStatus()
public String getStatusInfo()
private void setStatus(int retry)
public int getNbTry()
public int getNbFailures()
public String getErrorMsg()
public String getLastConnectTime()
public long getLatencyConnect()
private void setLatencyConnect(long latencyConnect)
public long getLatencyPubSub()
private void setLatencyPubSub(long latencyPubSub)
public int getTimeOut()
public void setTimeOut(int timeOut)
timeOut
- the maximum time waiting for connection.public String getCFName()
private void getConnectionFactory() throws NamingException
NamingException
public boolean check()
Copyright © 2022 ScalAgent D.T.. All rights reserved.