diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2008-11-21 03:44:20 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2008-11-21 03:44:20 +0000 |
| commit | c7e74dd9091e4c06aaee83bda9d6915f3d080455 (patch) | |
| tree | b526893318407a1749b0d91b283b654b9ff1c54d | |
| parent | 09d4f1d54e6365b7d4ccf83d9a4c19514ec11491 (diff) | |
| download | qpid-python-c7e74dd9091e4c06aaee83bda9d6915f3d080455.tar.gz | |
Added a script to startup QMan in standalone mode.
Added a man page, and a log4j file.
Modified the Configurator.java to throw an exception if it is unable to load the config file.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@719462 13f79535-47bb-0310-9956-ffa450edef68
6 files changed, 73 insertions, 2 deletions
diff --git a/qpid/java/management/client/bin/qman b/qpid/java/management/client/bin/qman new file mode 100755 index 0000000000..7c7d53cb7d --- /dev/null +++ b/qpid/java/management/client/bin/qman @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ "$QPID_LIB_PATH" = "" ] ; then + QPID_LIB_PATH=/usr/share/java +fi + +if [ "$QPID_CONFIG_PATH" = "" ] ; then + QPID_CONFIG_PATH=/etc +fi + +QMAN_CLASSPATH=`find $QPID_LIB_PATH | tr '\n' ":"` + +java -cp $QMAN_CLASSPATH -Dcom.sun.management.jmxremote -Dlog4j.configuration=qman.log4j -Dqman-config=$QPID_CONFIG_PATH/qman-config.xml org.apache.qpid.management.domain.services.QMan diff --git a/qpid/java/management/client/doc/man/qman b/qpid/java/management/client/doc/man/qman new file mode 100644 index 0000000000..cf4f90845c --- /dev/null +++ b/qpid/java/management/client/doc/man/qman @@ -0,0 +1,17 @@ +.TH qman +.SH NAME +qman is a Management bridge that exposes one (or several) Qpid broker domain model as MBeans that are accessible through the Java Management Extensions (JMX). Once you run qman you need to start a JMX Console such as JConsole to browse the MBeans exposed by Q-Man. +.SH SYNOPSIS +qman +.SH DESCRIPTION +For more information on customizing QMan for your own environment please read http://cwiki.apache.org/confluence/display/qpid/Qman+Tool +.SH Configuration +.SS Classpath +By default qman jars will be loaded from /usr/share/java. If you want to load from an alternative location you could specify it using QPID_LIB_PATH var. +.SS Config file +qman can be configured to connect to one or more brokers at startup by adding brokers in +.I /etc/qman-config.xml +If you want to load qman with qma-config.xml from a different location, you can specify it using QPID_CONFIG_PATH var. +.SS log4j configuration +qman expects qman.log4j file to be in the classpath. By default it will be put in +.I /usr/share/java diff --git a/qpid/java/management/client/etc/qman.log4j b/qpid/java/management/client/etc/qman.log4j new file mode 100644 index 0000000000..8a704ed6ef --- /dev/null +++ b/qpid/java/management/client/etc/qman.log4j @@ -0,0 +1,30 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +log4j.rootLogger=${root.logging.level} + +log4j.logger.org.apache.qpid=ERROR, console +log4j.additivity.org.apache.qpid=false + +log4j.logger.org.apache.qpid.management.client=DEBUG, console + +log4j.appender.console=org.apache.log4j.ConsoleAppender +log4j.appender.console.Threshold=all +log4j.appender.console.layout=org.apache.log4j.PatternLayout +log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n + diff --git a/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java b/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java index 34d46df0f9..47c1de7f3d 100644 --- a/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java +++ b/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java @@ -70,7 +70,7 @@ public interface Messages String QMAN_300001_MESSAGE_DISCARDED = "<QMAN-300001> : No handler has been configured for processing messages with \"%s\" as opcode. Message will be discarded.";
String QMAN_300002_UNKNOWN_SEQUENCE_NUMBER = "<QMAN-300002> : Unable to deal with incoming message because it contains a unknown sequence number (%s).";
String QMAN_300003_BROKER_ALREADY_CONNECTED = "<QMAN-300003> : Unable to enlist given broker connection data : QMan is already connected with broker %s";
- String QMAN_300004_UNVALID_CONFIGURATION_FILE = "<QMAN-300004> : The given configuration file (%s) is not valid (it doesn't exist or cannot be read)";
+ String QMAN_300004_INVALID_CONFIGURATION_FILE = "<QMAN-300004> : The given configuration file (%s) is not valid (it doesn't exist or cannot be read)";
// ERROR
String QMAN_100001_BAD_MAGIC_NUMBER_FAILURE = "<QMAN-100001> : Message processing failure : incoming message contains a bad magic number (%s) and therefore will be discaded.";
diff --git a/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/ConfigurationException.java b/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/ConfigurationException.java index 0ddbb3e1d8..6eed515e11 100644 --- a/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/ConfigurationException.java +++ b/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/ConfigurationException.java @@ -29,6 +29,11 @@ public class ConfigurationException extends Exception { private static final long serialVersionUID = 8238481177714286259L; + public ConfigurationException(String msg) + { + super(msg); + } + /** * Builds a new ConfigurationException with the given cause. * @@ -38,4 +43,9 @@ public class ConfigurationException extends Exception { super(exception); } + + public ConfigurationException(String msg,Exception exception) + { + super(msg,exception); + } }
\ No newline at end of file diff --git a/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configurator.java b/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configurator.java index 45962d9cd5..0051b19c99 100644 --- a/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configurator.java +++ b/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configurator.java @@ -139,7 +139,8 @@ public class Configurator extends DefaultHandler InputSource source = new InputSource(reader); parser.parse(source, this); } else { - LOGGER.warn(Messages.QMAN_300004_UNVALID_CONFIGURATION_FILE, initialConfigFileName); + LOGGER.warn(Messages.QMAN_300004_INVALID_CONFIGURATION_FILE, initialConfigFileName); + throw new ConfigurationException(String.format(Messages.QMAN_300004_INVALID_CONFIGURATION_FILE, initialConfigFileName)); } } |
