diff --git a/joram/joram/tools/jmscheck/src/main/java/org/ow2/joram/tools/jmscheck/Activator.java b/joram/joram/tools/jmscheck/src/main/java/org/ow2/joram/tools/jmscheck/Activator.java index 2faf4cf4211a3fda6a4e4628790095fc725756a0..a8161c7a60e92151ba74e5d30639ff00ce515b0e 100644 --- a/joram/joram/tools/jmscheck/src/main/java/org/ow2/joram/tools/jmscheck/Activator.java +++ b/joram/joram/tools/jmscheck/src/main/java/org/ow2/joram/tools/jmscheck/Activator.java @@ -21,7 +21,6 @@ */ package org.ow2.joram.tools.jmscheck; - import javax.naming.InitialContext; import org.objectweb.util.monolog.api.BasicLevel; @@ -32,6 +31,32 @@ import org.osgi.framework.BundleContext; import fr.dyade.aaa.agent.AgentServer; import fr.dyade.aaa.common.Debug; +/** + * 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: + * For each JMS connector to monitor there is 4 properties to define: + * If there are multiple connectors to monitor, suffix each property with 1, 2, etc. + */ public class Activator implements BundleActivator { public static final Logger logger = Debug.getLogger(Activator.class.getName()); @@ -144,7 +169,6 @@ public class Activator implements BundleActivator { jmsStatus.start(); } - // public synchronized Object lookup(String name) throws NamingException { // if (logger.isLoggable(BasicLevel.DEBUG)) // logger.log(BasicLevel.DEBUG, "Helper.lookup " + name); diff --git a/joram/joram/tools/jmscheck/src/main/java/org/ow2/joram/tools/jmscheck/JMSCheck.java b/joram/joram/tools/jmscheck/src/main/java/org/ow2/joram/tools/jmscheck/JMSCheck.java index 85d1519d4434b53ebfda1895fa8895e4430fd196..23d6812c2ceacc3c6c26b488d88b56a8d06960d6 100644 --- a/joram/joram/tools/jmscheck/src/main/java/org/ow2/joram/tools/jmscheck/JMSCheck.java +++ b/joram/joram/tools/jmscheck/src/main/java/org/ow2/joram/tools/jmscheck/JMSCheck.java @@ -1,5 +1,29 @@ +/* + * Copyright (C) 2020 ScalAgent Distributed Technologies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + * + * Initial developer(s): ScalAgent Distributed Technologies + * Contributor(s): + */ package org.ow2.joram.tools.jmscheck; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Properties; import javax.naming.InitialContext; @@ -8,31 +32,120 @@ import org.objectweb.util.monolog.api.Logger; import fr.dyade.aaa.common.Debug; +/** + * 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):