Package org.ow2.joram.tools.jmscheck
Class JMSCheck
- java.lang.Object
-
- org.ow2.joram.tools.jmscheck.JMSCheck
-
public final class JMSCheck extends Object
This client regularly tests the state of a JMS connector and publishes the results to JMX.
usage: java -DJNDI_FILE=./jndi.properties -DPERIOD=1 -DTIMEOUT=5000
- -DCF=cf -DQUEUE=queue
- -jar jmscheck.jar [help]
Options, set by Java environment variable ("-Dproperty=value" in command line):- JNDI_FILE: Path of JNDI properties file. If not defined, Joram's default are
used. "fr.dyade.aaa.jndi2.client.NamingContextFactory" for JNDI Factory,
"localhost", and 16400 for host and port.
These values can be overloaded by specific properties below. - JNDI_FACTORY: Classname of the JNDI factory (cf java.naming.factory.initial property).
- JNDI_HOST: Hostname ou IP address of JNDI server.
- JNDI_PORT: Listening port of JNDI server.
- PERIOD: Period between 2 checks, by default 60s.
- TIMEOUT: Maximum amount of time to wait connecting and receiving messages, by default 10s.
- CF: JNDI name of the ConnectionFactory to use.
- QUEUE: Internal name of JMS destination.
- USER: User name for authentication, if no defined uses the ConnectionFactory default.
- PASS: Password for authentication, if no defined uses the ConnectionFactory default.
For each JMS connector to monitor there is 4 properties to define:
All these properties can be defined in a file whose name is given by the CONF_FILE property. In this case the other properties defined in the command line are ignored.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCF_NAMEstatic StringCONF_FILEstatic StringGLOBAL_PERIODstatic StringGLOBAL_TIMEOUT(package private) static JMSStatusjmsStatusstatic StringJNDI_FACTORYstatic StringJNDI_FILEstatic StringJNDI_HOSTstatic StringJNDI_PORTstatic Loggerloggerstatic StringPASSWORD(package private) static intperiodstatic StringQUEUE_NAME(package private) static inttimeoutstatic StringUSER_NAME
-
Constructor Summary
Constructors Constructor Description JMSCheck()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static booleancreateConnector(Properties props, JMSStatus jmsStatus, String suffix, InitialContext ictx)Adds a new check component using the related properties.static voidmain(String[] args)
-
-
-
Field Detail
-
logger
public static final Logger logger
-
GLOBAL_PERIOD
public static final String GLOBAL_PERIOD
- See Also:
- Constant Field Values
-
GLOBAL_TIMEOUT
public static final String GLOBAL_TIMEOUT
- See Also:
- Constant Field Values
-
JNDI_FILE
public static final String JNDI_FILE
- See Also:
- Constant Field Values
-
JNDI_FACTORY
public static final String JNDI_FACTORY
- See Also:
- Constant Field Values
-
JNDI_HOST
public static final String JNDI_HOST
- See Also:
- Constant Field Values
-
JNDI_PORT
public static final String JNDI_PORT
- See Also:
- Constant Field Values
-
CF_NAME
public static final String CF_NAME
- See Also:
- Constant Field Values
-
USER_NAME
public static final String USER_NAME
- See Also:
- Constant Field Values
-
PASSWORD
public static final String PASSWORD
- See Also:
- Constant Field Values
-
QUEUE_NAME
public static final String QUEUE_NAME
- See Also:
- Constant Field Values
-
CONF_FILE
public static final String CONF_FILE
- See Also:
- Constant Field Values
-
period
static int period
-
timeout
static int timeout
-
jmsStatus
static JMSStatus jmsStatus
-
-
Method Detail
-
createConnector
private static boolean createConnector(Properties props, JMSStatus jmsStatus, String suffix, InitialContext ictx)
Adds a new check component using the related properties.- Parameters:
check- The root component.suffix- The property suffix.ictx- The InitialContext to use.- Returns:
- True if the component is successively created.
-
-