Package org.ow2.joram.tools.jmscheck
Class Activator
- java.lang.Object
-
- org.ow2.joram.tools.jmscheck.Activator
-
- All Implemented Interfaces:
org.osgi.framework.BundleActivator
public final class Activator extends Object implements org.osgi.framework.BundleActivator
This component regularly tests the state of a JMS connector and publishes the results to JMX.
It is configured through a set of OSGi properties:- org.ow2.joram.check.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. - org.ow2.joram.check.jndi.factory: Classname of the JNDI factory (cf java.naming.factory.initial property).
- org.ow2.joram.check.jndi.host: Hostname ou IP address of JNDI server.
- org.ow2.joram.check.jndi.port: Listening port of JNDI server.
- org.ow2.joram.check.period: Period between 2 checks, by default 60s.
- org.ow2.joram.check.timeout: Maximum amount of time to wait connecting and receiving messages, by default 10s.
- org.ow2.joram.check.cf: JNDI name of the ConnectionFactory to use.
- org.ow2.joram.check.queue: Internal name of JMS destination.
- org.ow2.joram.check.user: User name for authentication, if no defined uses the ConnectionFactory default.
- org.ow2.joram.check.pass: Password for authentication, if no defined uses the ConnectionFactory default.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCF_NAMEstatic StringCHECK_PREFIXprivate static org.osgi.framework.BundleContextcontextstatic StringDUMP_DELAYstatic StringDUMP_FILEstatic StringDUMP_THRESHOLDstatic StringGLOBAL_PERIODstatic StringGLOBAL_TIMEOUT(package private) JMSStatusjmsStatusstatic StringJNDI_FACTORYstatic StringJNDI_FILEstatic StringJNDI_HOSTstatic StringJNDI_PORTstatic Loggerloggerstatic StringPASSWORD(package private) intperiodstatic StringQUEUE_NAME(package private) inttimeoutstatic StringUSER_NAME
-
Constructor Summary
Constructors Constructor Description Activator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleancreateConnector(JMSStatus check, String suffix, InitialContext ictx)Adds a new check component using the related properties.voidstart(org.osgi.framework.BundleContext context)voidstop(org.osgi.framework.BundleContext context)
-
-
-
Field Detail
-
logger
public static final Logger logger
-
CHECK_PREFIX
public static final String CHECK_PREFIX
- See Also:
- Constant Field Values
-
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
-
DUMP_FILE
public static final String DUMP_FILE
- See Also:
- Constant Field Values
-
DUMP_THRESHOLD
public static final String DUMP_THRESHOLD
- See Also:
- Constant Field Values
-
DUMP_DELAY
public static final String DUMP_DELAY
- 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
-
context
private static org.osgi.framework.BundleContext context
-
period
int period
-
timeout
int timeout
-
jmsStatus
JMSStatus jmsStatus
-
-
Method Detail
-
start
public void start(org.osgi.framework.BundleContext context) throws Exception- Specified by:
startin interfaceorg.osgi.framework.BundleActivator- Throws:
Exception
-
createConnector
private boolean createConnector(JMSStatus check, 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.
-
-