From c607ae1310cb2ca5ade20bbae49bae6caa5c44bb Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Wed, 28 Jan 2009 17:55:23 +0000 Subject: This is related to QPID-1619 Added the man page back. Renamed qman-jmx-start to qman-jmx and there is no corresponding stop script. Added a simple qman.log4j Ran dos2unix on qman-config.xml git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@738568 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/java/management/client/bin/qman-jmx-start.cmd | 78 -------------------- qpid/java/management/client/bin/qman-jmx-start.sh | 75 ------------------- qpid/java/management/client/bin/qman-jmx.cmd | 78 ++++++++++++++++++++ qpid/java/management/client/bin/qman-jmx.sh | 86 ++++++++++++++++++++++ qpid/java/management/client/doc/man/qman-jmx | 17 +++++ qpid/java/management/client/etc/qman-config.xml | 40 +++++----- qpid/java/management/client/etc/qman.log4j | 29 ++++++++ 7 files changed, 230 insertions(+), 173 deletions(-) delete mode 100644 qpid/java/management/client/bin/qman-jmx-start.cmd delete mode 100644 qpid/java/management/client/bin/qman-jmx-start.sh create mode 100644 qpid/java/management/client/bin/qman-jmx.cmd create mode 100644 qpid/java/management/client/bin/qman-jmx.sh create mode 100644 qpid/java/management/client/doc/man/qman-jmx create mode 100644 qpid/java/management/client/etc/qman.log4j (limited to 'qpid/java') diff --git a/qpid/java/management/client/bin/qman-jmx-start.cmd b/qpid/java/management/client/bin/qman-jmx-start.cmd deleted file mode 100644 index c04241494d..0000000000 --- a/qpid/java/management/client/bin/qman-jmx-start.cmd +++ /dev/null @@ -1,78 +0,0 @@ -@echo off - -@rem Licensed to the Apache Software Foundation (ASF) under one -@rem or more contributor license agreements. See the NOTICE file -@rem distributed with this work for additional information -@rem regarding copyright ownership. The ASF licenses this file -@rem to you under the Apache License, Version 2.0 (the -@rem "License"); you may not use this file except in compliance -@rem with the License. You may obtain a copy of the License at -@rem -@rem http://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, -@rem software distributed under the License is distributed on an -@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@rem KIND, either express or implied. See the License for the -@rem specific language governing permissions and limitations -@rem under the License. - -@rem ************************************************************************* -@rem This script is used to initialize environment to start QMan JMX Adapter. -@rem It uses several environment variables described below. -@rem You can edit this file according to your environment or (reccommended) set their -@rem values outside this script. -@rem -@rem It sets (or retrieve from the environment if defined) the following variables: -@rem -@rem QMAN_HOME - The home directory of your QMan installation. -@rem JAVA_HOME - Location of the version of Java runtime used to start QMan. -@rem QMAN_CONFIG_FILE - Location of the QMan configuration file. -@rem ************************************************************************** - -cls - -:CHECK JVM -set JAVA=%JAVA_HOME%\bin\java -set JAVA_OPTS=-Xms128m -Xmx512m - -if not "%JAVA_HOME%" == "" goto CONFIGURE AND START - -set JAVA=java - -echo. -echo WARNING : JAVA_HOME is not set so unexpected results may occur. -echo Please set JAVA_HOME to the directory of your local JDK / JRE to avoid this message. - -:CONFIGURE AND START - -if "%QMAN_HOME%" == "" SET QMAN_HOME=.. -if "%QMAN_CONFIG_FILE%" == "" SET QMAN_CONFIG_FILE=%QMAN_HOME%\etc\qman-config.xml - -SET QMAN_LIBS=%QMAN_HOME%\lib -SET QMAN_CLASSPATH=%QMAN_HOME%\etc - -setlocal ENABLEDELAYEDEXPANSION - -FOR /R %QMAN_LIBS% %%G IN (*.jar) DO set QMAN_CLASSPATH=!QMAN_CLASSPATH!;%%G - -:START -echo =============================================================================== -echo. -echo QMan JMX Bridge Bootstrap Environment -echo -------------------------------------------------- -echo. -echo QMan HOME : %QMAN_HOME% -echo. -echo Java executable : %JAVA% -echo. -echo Java Opts : %JAVA_OPTS% -echo. -echo Configuration file : %QMAN_CONFIG_FILE% -echo. -echo Bootstrap classpath : %QMAN_CLASSPATH% -echo. -echo =============================================================================== -echo. - -"%JAVA%" %JAVA_OPTS% -Dcom.sun.management.jmxremote -Dqman-config=%QMAN_CONFIG_FILE% -classpath "%QMAN_CLASSPATH%" org.apache.qpid.management.domain.services.QMan \ No newline at end of file diff --git a/qpid/java/management/client/bin/qman-jmx-start.sh b/qpid/java/management/client/bin/qman-jmx-start.sh deleted file mode 100644 index 14bf663516..0000000000 --- a/qpid/java/management/client/bin/qman-jmx-start.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh - -# 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. -# -# ************************************************************************* -# This script is used to initialize environment to start QMan JMX Adapter. -# It uses several environment variables described below. -# You can edit this file according to your environment or (reccommended) set their -# values outside this script. -# -# It sets (or retrieve from the environment if defined) the following variables: -# -# QMAN_HOME - The home directory of your QMan installation. -# JAVA_HOME - Location of the version of Java runtime used to start QMan. -# QMAN_CONFIG_FILE - Location of the QMan configuration file. -# ************************************************************************** - -clear - -JAVA=$JAVA_HOME/bin/java -JAVA_OPTS="-Xms128m -Xmx512m" - -if [ "$JAVA_HOME" = "" ] ; then - echo "JAVA_HOME is not set. Unexpected results may occur." - echo "Set JAVA_HOME to the directory of your local JDK to avoid this message." - JAVA=java -fi - -if [ "$QMAN_HOME" = "" ] ; then - QMAN_HOME=.. -fi - -if [ "$QMAN_CONFIG_FILE" = "" ] ; then - QMAN_CONFIG_FILE=$QMAN_HOME/etc/qman-config.xml -fi - -QMAN_LIBS=$QMAN_HOME/lib - -QMAN_CLASSPATH=`find $QMAN_LIBS | tr '\n' ":"` -QMAN_CLASSPATH=$QMAN_CLASSPATH:$QMAN_HOME/etc - -echo "===============================================================================" -echo "" -echo "QMan JMX Bridge Bootstrap Environment" -echo "--------------------------------------------------" -echo "" -echo "QMan HOME : $QMAN_HOME" -echo "" -echo "Java executable : $JAVA" -echo "" -echo "Java Opts : $JAVA_OPTS" -echo "" -echo "Configuration file : $QMAN_CONFIG_FILE" -echo "" -echo "Bootstrap classpath : $QMAN_CLASSPATH" -echo "" -echo "===============================================================================" -echo "" - -"$JAVA" $JAVA_OPTS -cp $QMAN_CLASSPATH -Dcom.sun.management.jmxremote -Dqman-config=$QMAN_CONFIG_FILE org.apache.qpid.management.domain.services.QMan \ No newline at end of file diff --git a/qpid/java/management/client/bin/qman-jmx.cmd b/qpid/java/management/client/bin/qman-jmx.cmd new file mode 100644 index 0000000000..c04241494d --- /dev/null +++ b/qpid/java/management/client/bin/qman-jmx.cmd @@ -0,0 +1,78 @@ +@echo off + +@rem Licensed to the Apache Software Foundation (ASF) under one +@rem or more contributor license agreements. See the NOTICE file +@rem distributed with this work for additional information +@rem regarding copyright ownership. The ASF licenses this file +@rem to you under the Apache License, Version 2.0 (the +@rem "License"); you may not use this file except in compliance +@rem with the License. You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, +@rem software distributed under the License is distributed on an +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@rem KIND, either express or implied. See the License for the +@rem specific language governing permissions and limitations +@rem under the License. + +@rem ************************************************************************* +@rem This script is used to initialize environment to start QMan JMX Adapter. +@rem It uses several environment variables described below. +@rem You can edit this file according to your environment or (reccommended) set their +@rem values outside this script. +@rem +@rem It sets (or retrieve from the environment if defined) the following variables: +@rem +@rem QMAN_HOME - The home directory of your QMan installation. +@rem JAVA_HOME - Location of the version of Java runtime used to start QMan. +@rem QMAN_CONFIG_FILE - Location of the QMan configuration file. +@rem ************************************************************************** + +cls + +:CHECK JVM +set JAVA=%JAVA_HOME%\bin\java +set JAVA_OPTS=-Xms128m -Xmx512m + +if not "%JAVA_HOME%" == "" goto CONFIGURE AND START + +set JAVA=java + +echo. +echo WARNING : JAVA_HOME is not set so unexpected results may occur. +echo Please set JAVA_HOME to the directory of your local JDK / JRE to avoid this message. + +:CONFIGURE AND START + +if "%QMAN_HOME%" == "" SET QMAN_HOME=.. +if "%QMAN_CONFIG_FILE%" == "" SET QMAN_CONFIG_FILE=%QMAN_HOME%\etc\qman-config.xml + +SET QMAN_LIBS=%QMAN_HOME%\lib +SET QMAN_CLASSPATH=%QMAN_HOME%\etc + +setlocal ENABLEDELAYEDEXPANSION + +FOR /R %QMAN_LIBS% %%G IN (*.jar) DO set QMAN_CLASSPATH=!QMAN_CLASSPATH!;%%G + +:START +echo =============================================================================== +echo. +echo QMan JMX Bridge Bootstrap Environment +echo -------------------------------------------------- +echo. +echo QMan HOME : %QMAN_HOME% +echo. +echo Java executable : %JAVA% +echo. +echo Java Opts : %JAVA_OPTS% +echo. +echo Configuration file : %QMAN_CONFIG_FILE% +echo. +echo Bootstrap classpath : %QMAN_CLASSPATH% +echo. +echo =============================================================================== +echo. + +"%JAVA%" %JAVA_OPTS% -Dcom.sun.management.jmxremote -Dqman-config=%QMAN_CONFIG_FILE% -classpath "%QMAN_CLASSPATH%" org.apache.qpid.management.domain.services.QMan \ No newline at end of file diff --git a/qpid/java/management/client/bin/qman-jmx.sh b/qpid/java/management/client/bin/qman-jmx.sh new file mode 100644 index 0000000000..9058999bef --- /dev/null +++ b/qpid/java/management/client/bin/qman-jmx.sh @@ -0,0 +1,86 @@ +#!/bin/sh + +# 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. +# +# ************************************************************************* +# This script is used to initialize environment to start QMan JMX Adapter. +# It uses several environment variables described below. +# You can edit this file according to your environment or (reccommended) set their +# values outside this script. +# +# It sets (or retrieve from the environment if defined) the following variables: +# +# QMAN_HOME - The home directory of your QMan installation. +# JAVA_HOME - Location of the version of Java runtime used to start QMan. +# QMAN_CONFIG_FILE - Location of the QMan configuration file. +# ************************************************************************** + +clear + +JAVA=$JAVA_HOME/bin/java +JAVA_OPTS="-Xms128m -Xmx512m" + +if [ "$JAVA_HOME" = "" ] ; then + echo "JAVA_HOME is not set. Unexpected results may occur." + echo "Set JAVA_HOME to the directory of your local JDK to avoid this message." + JAVA=java +fi + +if [ "$QMAN_HOME" = "" ] ; then + + if [ "$QPID_LIB_PATH" = "" ] ; then + QPID_LIB_PATH=/usr/share/java + fi + + if [ "$QMAN_CONFIG_FILE" = "" ] ; then + QMAN_CONFIG_FILE=/etc/qman-config.xml + QMAN_LOG4J=/etc/qman.log4j + fi +else + if [ "$QPID_LIB_PATH" = "" ] ; then + QPID_LIB_PATH=$QMAN_HOME/lib + fi + + if [ "$QMAN_CONFIG_FILE" = "" ] ; then + QMAN_CONFIG_FILE=$QMAN_HOME/etc/qman-config.xml + QMAN_LOG4J=$QMAN_HOME/etc/qman.log4j + fi +fi + +QMAN_CLASSPATH=`find $QMAN_LIBS | tr '\n' ":"` +QMAN_CLASSPATH=$QMAN_LOG4J:$QMAN_CLASSPATH + +echo "===============================================================================" +echo "" +echo "QMan JMX Bridge Bootstrap Environment" +echo "--------------------------------------------------" +echo "" +echo "QMan HOME : $QMAN_HOME" +echo "" +echo "Java executable : $JAVA" +echo "" +echo "Java Opts : $JAVA_OPTS" +echo "" +echo "Configuration file : $QMAN_CONFIG_FILE" +echo "" +echo "Log4J file : $QMAN_LOG4J" +echo "" +echo "===============================================================================" +echo "" + +"$JAVA" $JAVA_OPTS -cp $QMAN_CLASSPATH -Dcom.sun.management.jmxremote -Dlog4j.configuration=qman.log4j -Dqman-config=$QMAN_CONFIG_FILE org.apache.qpid.management.domain.services.QMan diff --git a/qpid/java/management/client/doc/man/qman-jmx b/qpid/java/management/client/doc/man/qman-jmx new file mode 100644 index 0000000000..064c00eae5 --- /dev/null +++ b/qpid/java/management/client/doc/man/qman-jmx @@ -0,0 +1,17 @@ +.TH qman-jmx +.SH NAME +qman-jmx 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-jmx 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 qman-config.xml from a different location, you can specify it using QPID_CONFIG_FILE 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-config.xml b/qpid/java/management/client/etc/qman-config.xml index beb33acfc9..c1a5da9184 100644 --- a/qpid/java/management/client/etc/qman-config.xml +++ b/qpid/java/management/client/etc/qman-config.xml @@ -18,17 +18,17 @@ - under the License. - --> - - + + + localhost + 5672 + test + guest + guest + 4 + 0 + -1 + + + --> diff --git a/qpid/java/management/client/etc/qman.log4j b/qpid/java/management/client/etc/qman.log4j new file mode 100644 index 0000000000..bf6f940a6c --- /dev/null +++ b/qpid/java/management/client/etc/qman.log4j @@ -0,0 +1,29 @@ +# +# 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=error +log4j.appender.console.layout=org.apache.log4j.PatternLayout +log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n -- cgit v1.2.1