ACTIVEMQ6-4 - more refactoring
https://issues.apache.org/jira/browse/ACTIVEMQ6-4 renamed all the scripts and run commands and variables to be ActiveMQ
This commit is contained in:
parent
b5039ab8d5
commit
f9bdb25aef
|
@ -23,17 +23,17 @@ import org.apache.activemq.cli.commands.Stop;
|
|||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
public class HornetQ
|
||||
public class ActiveMQ
|
||||
{
|
||||
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
Cli.CliBuilder<Action> builder = Cli.<Action>builder("hornetq")
|
||||
Cli.CliBuilder<Action> builder = Cli.<Action>builder("activemq")
|
||||
.withDefaultCommand(HelpAction.class)
|
||||
.withCommand(Run.class)
|
||||
.withCommand(Stop.class)
|
||||
.withCommand(HelpAction.class)
|
||||
.withDescription("HornetQ Command Line");
|
||||
.withDescription("ActiveMQ Command Line");
|
||||
|
||||
Cli<Action> parser = builder.build();
|
||||
|
||||
|
@ -51,14 +51,14 @@ public class HornetQ
|
|||
{
|
||||
System.err.println(configException.getMessage());
|
||||
System.out.println();
|
||||
System.out.println("Configuration should be specified as 'scheme:location'. Default configuration is 'xml:${HORNETQ_HOME}/config/non-clustered/bootstrap.xml'");
|
||||
System.out.println("Configuration should be specified as 'scheme:location'. Default configuration is 'xml:${ACTIVEMQ_HOME}/config/non-clustered/bootstrap.xml'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void printBanner() throws Exception
|
||||
{
|
||||
copy(HornetQ.class.getResourceAsStream("banner.txt"), System.out);
|
||||
copy(ActiveMQ.class.getResourceAsStream("banner.txt"), System.out);
|
||||
}
|
||||
|
||||
private static long copy(InputStream in, OutputStream out) throws Exception
|
|
@ -15,7 +15,7 @@ package org.apache.activemq.cli.commands;
|
|||
import io.airlift.command.Arguments;
|
||||
import io.airlift.command.Command;
|
||||
|
||||
import org.apache.activemq.cli.HornetQ;
|
||||
import org.apache.activemq.cli.ActiveMQ;
|
||||
import org.apache.activemq.core.config.Configuration;
|
||||
import org.apache.activemq.core.server.impl.HornetQServerImpl;
|
||||
import org.apache.activemq.dto.BrokerDTO;
|
||||
|
@ -41,7 +41,7 @@ import java.util.TimerTask;
|
|||
public class Run implements Action
|
||||
{
|
||||
|
||||
@Arguments(description = "Broker Configuration URI, default 'xml:${HORNETQ_HOME}/config/non-clustered/bootstrap.xml'")
|
||||
@Arguments(description = "Broker Configuration URI, default 'xml:${ACTIVEMQ_HOME}/config/non-clustered/bootstrap.xml'")
|
||||
String configuration;
|
||||
private StandaloneNamingServer namingServer;
|
||||
private JMSServerManager jmsServerManager;
|
||||
|
@ -50,11 +50,11 @@ public class Run implements Action
|
|||
public Object execute(ActionContext context) throws Exception
|
||||
{
|
||||
|
||||
HornetQ.printBanner();
|
||||
ActiveMQ.printBanner();
|
||||
|
||||
if (configuration == null)
|
||||
{
|
||||
configuration = "xml:" + System.getProperty("hornetq.home").replace("\\", "/") + "/config/non-clustered/bootstrap.xml";
|
||||
configuration = "xml:" + System.getProperty("activemq.home").replace("\\", "/") + "/config/non-clustered/bootstrap.xml";
|
||||
}
|
||||
|
||||
System.out.println("Loading configuration file: " + configuration);
|
||||
|
@ -117,7 +117,7 @@ public class Run implements Action
|
|||
HornetQBootstrapLogger.LOGGER.errorDeletingFile(file.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
final Timer timer = new Timer("HornetQ Server Shutdown Timer", true);
|
||||
final Timer timer = new Timer("ActiveMQ Server Shutdown Timer", true);
|
||||
timer.scheduleAtFixedRate(new TimerTask()
|
||||
{
|
||||
@Override
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.io.File;
|
|||
@Command(name = "stop", description = "stops the broker instance")
|
||||
public class Stop implements Action
|
||||
{
|
||||
@Arguments(description = "Broker Configuration URI, default 'xml:${HORNETQ_HOME}/config/non-clustered/bootstrap.xml'")
|
||||
@Arguments(description = "Broker Configuration URI, default 'xml:${ACTIVEMQ_HOME}/config/non-clustered/bootstrap.xml'")
|
||||
String configuration;
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,7 @@ public class Stop implements Action
|
|||
{
|
||||
if (configuration == null)
|
||||
{
|
||||
configuration = "xml:" + System.getProperty("hornetq.home").replace("\\", "/") + "/config/non-clustered/bootstrap.xml";
|
||||
configuration = "xml:" + System.getProperty("activemq.home").replace("\\", "/") + "/config/non-clustered/bootstrap.xml";
|
||||
}
|
||||
BrokerDTO broker = BrokerFactory.createBroker(configuration);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class BrokerFactory
|
|||
BrokerFactoryHandler factory = null;
|
||||
try
|
||||
{
|
||||
FactoryFinder finder = new FactoryFinder("META-INF/services/org.apache.activemq/broker/");
|
||||
FactoryFinder finder = new FactoryFinder("META-INF/services/org/apache/activemq/broker/");
|
||||
factory = (BrokerFactoryHandler)finder.newInstance(configURI.getScheme());
|
||||
}
|
||||
catch (IOException ioe )
|
||||
|
|
|
@ -31,7 +31,7 @@ public class CoreFactory
|
|||
URI configURI = new URI(core.configuration.replace("\\", "/"));
|
||||
try
|
||||
{
|
||||
FactoryFinder finder = new FactoryFinder("META-INF/services/org.apache.activemq/broker/core/");
|
||||
FactoryFinder finder = new FactoryFinder("META-INF/services/org/apache/activemq/broker/core/");
|
||||
factory = (CoreFactoryHandler)finder.newInstance(configURI.getScheme());
|
||||
}
|
||||
catch (IOException ioe )
|
||||
|
|
|
@ -30,7 +30,7 @@ public class JmsFactory
|
|||
URI configURI = new URI(jms.configuration.replace("\\", "/"));
|
||||
try
|
||||
{
|
||||
FactoryFinder finder = new FactoryFinder("META-INF/services/org.apache.activemq/broker/jms/");
|
||||
FactoryFinder finder = new FactoryFinder("META-INF/services/org/apache/activemq/broker/jms/");
|
||||
factory = (JmsFactoryHandler)finder.newInstance(configURI.getScheme());
|
||||
}
|
||||
catch (IOException ioe )
|
||||
|
|
|
@ -25,7 +25,7 @@ public class SecurityManagerFactory
|
|||
{
|
||||
if (config != null)
|
||||
{
|
||||
FactoryFinder finder = new FactoryFinder("META-INF/services/org.apache.activemq/security/");
|
||||
FactoryFinder finder = new FactoryFinder("META-INF/services/org/apache/activemq/security/");
|
||||
HornetQSecurityManager manager = (HornetQSecurityManager)finder.newInstance(config.getClass().getAnnotation(XmlRootElement.class).name());
|
||||
return manager;
|
||||
}
|
||||
|
|
|
@ -46,11 +46,11 @@ public interface HornetQBootstrapLogger extends BasicLogger
|
|||
HornetQBootstrapLogger LOGGER = Logger.getMessageLogger(HornetQBootstrapLogger.class, HornetQBootstrapLogger.class.getPackage().getName());
|
||||
|
||||
@LogMessage(level = Logger.Level.INFO)
|
||||
@Message(id = 101000, value = "Starting HornetQ Server", format = Message.Format.MESSAGE_FORMAT)
|
||||
@Message(id = 101000, value = "Starting ActiveMQ Server", format = Message.Format.MESSAGE_FORMAT)
|
||||
void serverStarting();
|
||||
|
||||
@LogMessage(level = Logger.Level.INFO)
|
||||
@Message(id = 101001, value = "Stopping HornetQ Server", format = Message.Format.MESSAGE_FORMAT)
|
||||
@Message(id = 101001, value = "Stopping ActiveMQ Server", format = Message.Format.MESSAGE_FORMAT)
|
||||
void serverStopping();
|
||||
|
||||
@LogMessage(level = Logger.Level.INFO)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
|
||||
if [ -z "$HORNETQ_HOME" ] ; then
|
||||
if [ -z "$ACTIVEMQ_HOME" ] ; then
|
||||
|
||||
## resolve links - $0 may be a link to hornetq's home
|
||||
## resolve links - $0 may be a link to ActiveMQ's home
|
||||
PRG="$0"
|
||||
progname=`basename "$0"`
|
||||
saveddir=`pwd`
|
||||
|
@ -22,11 +22,11 @@ if [ -z "$HORNETQ_HOME" ] ; then
|
|||
fi
|
||||
done
|
||||
|
||||
HORNETQ_HOME=`dirname "$PRG"`
|
||||
ACTIVEMQ_HOME=`dirname "$PRG"`
|
||||
cd "$saveddir"
|
||||
|
||||
# make it fully qualified
|
||||
HORNETQ_HOME=`cd "$HORNETQ_HOME/.." && pwd`
|
||||
ACTIVEMQ_HOME=`cd "$ACTIVEMQ_HOME/.." && pwd`
|
||||
fi
|
||||
|
||||
# OS specific support.
|
||||
|
@ -46,8 +46,8 @@ esac
|
|||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$HORNETQ_HOME" ] &&
|
||||
HORNETQ_HOME=`cygpath --unix "$HORNETQ_HOME"`
|
||||
[ -n "$ACTIVEMQ_HOME" ] &&
|
||||
ACTIVEMQ_HOME=`cygpath --unix "$ACTIVEMQ_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
|
@ -76,12 +76,12 @@ if [ ! -x "$JAVACMD" ] ; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
for i in `ls $HORNETQ_HOME/lib/*.jar`; do
|
||||
for i in `ls $ACTIVEMQ_HOME/lib/*.jar`; do
|
||||
CLASSPATH=$i:$CLASSPATH
|
||||
done
|
||||
|
||||
|
||||
JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces -Dhornetq.home=$HORNETQ_HOME -Ddata.dir=$HORNETQ_HOME/data -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=file:$HORNETQ_HOME/config/logging.properties -Djava.library.path=$HORNETQ_HOME/bin/lib/linux-i686:$HORNETQ_HOME/bin/lib/linux-x86_64"
|
||||
JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces -Dactivemq.home=$ACTIVEMQ_HOME -Ddata.dir=$ACTIVEMQ_HOME/data -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=file:$ACTIVEMQ_HOME/config/logging.properties -Djava.library.path=$ACTIVEMQ_HOME/bin/lib/linux-i686:$ACTIVEMQ_HOME/bin/lib/linux-x86_64"
|
||||
#JAVA_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces"
|
||||
|
||||
exec "$JAVACMD" $JAVA_ARGS -classpath $CLASSPATH org.apache.activemq.cli.HornetQ $@
|
||||
exec "$JAVACMD" $JAVA_ARGS -classpath $CLASSPATH org.apache.activemq.cli.ActiveMQ $@
|
|
@ -3,11 +3,11 @@
|
|||
service=`basename "$0"`
|
||||
|
||||
#
|
||||
# Discover the HORNETQ_BASE from the location of this script.
|
||||
# Discover the ACTIVEMQ_BASE from the location of this script.
|
||||
#
|
||||
if [ -z "$HORNETQ_BASE" ] ; then
|
||||
if [ -z "$ACTIVEMQ_BASE" ] ; then
|
||||
|
||||
## resolve links - $0 may be a link to HORNETQ's home
|
||||
## resolve links - $0 may be a link to ActiveMQ's home
|
||||
PRG="$0"
|
||||
saveddir=`pwd`
|
||||
|
||||
|
@ -25,19 +25,19 @@ if [ -z "$HORNETQ_BASE" ] ; then
|
|||
fi
|
||||
done
|
||||
|
||||
HORNETQ_BASE=`dirname "$PRG"`
|
||||
ACTIVEMQ_BASE=`dirname "$PRG"`
|
||||
cd "$saveddir"
|
||||
|
||||
# make it fully qualified
|
||||
HORNETQ_BASE=`cd "$HORNETQ_BASE/.." && pwd`
|
||||
export HORNETQ_BASE
|
||||
ACTIVEMQ_BASE=`cd "$ACTIVEMQ_BASE/.." && pwd`
|
||||
export ACTIVEMQ_BASE
|
||||
|
||||
fi
|
||||
|
||||
PID_FILE="${HORNETQ_BASE}/data/hornetq.pid"
|
||||
PID_FILE="${ACTIVEMQ_BASE}/data/activemq.pid"
|
||||
|
||||
if [ ! -d "${HORNETQ_BASE}/data/" ]; then
|
||||
mkdir "${HORNETQ_BASE}/data/"
|
||||
if [ ! -d "${ACTIVEMQ_BASE}/data/" ]; then
|
||||
mkdir "${ACTIVEMQ_BASE}/data/"
|
||||
fi
|
||||
|
||||
status() {
|
||||
|
@ -79,7 +79,7 @@ start() {
|
|||
return 1
|
||||
fi
|
||||
|
||||
nohup ${HORNETQ_BASE}/bin/hornetq run > /dev/null 2> /dev/null &
|
||||
nohup ${ACTIVEMQ_BASE}/bin/activemq run > /dev/null 2> /dev/null &
|
||||
|
||||
echo $! > "${PID_FILE}"
|
||||
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
setlocal
|
||||
|
||||
if NOT "%HORNETQ_HOME%"=="" goto CHECK_HORNETQ_HOME
|
||||
if NOT "%ACTIVEMQ_HOME%"=="" goto CHECK_ACTIVEMQ_HOME
|
||||
PUSHD .
|
||||
CD %~dp0..
|
||||
set HORNETQ_HOME=%CD%
|
||||
set ACTIVEMQ_HOME=%CD%
|
||||
POPD
|
||||
|
||||
:CHECK_HORNETQ_HOME
|
||||
if exist "%HORNETQ_HOME%\bin\hornetq.cmd" goto CHECK_JAVA
|
||||
:CHECK_ACTIVEMQ_HOME
|
||||
if exist "%ACTIVEMQ_HOME%\bin\activemq.cmd" goto CHECK_JAVA
|
||||
|
||||
:NO_HOME
|
||||
echo HORNETQ_HOME environment variable is set incorrectly. Please set HORNETQ_HOME.
|
||||
echo ACTIVEMQ_HOME environment variable is set incorrectly. Please set ACTIVEMQ_HOME.
|
||||
goto END
|
||||
|
||||
:CHECK_JAVA
|
||||
|
@ -31,25 +31,25 @@ echo.
|
|||
|
||||
:RUN_JAVA
|
||||
|
||||
if "%JVM_FLAGS%" == "" set JVM_FLAGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces -Dhornetq.home=$HORNETQ_HOME -Ddata.dir=$HORNETQ_HOME/data -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration="file:%HORNETQ_HOME%\config\logging.properties" -Djava.library.path="%HORNETQ_HOME%/bin/lib/linux-i686:%HORNETQ_HOME%/bin/lib/linux-x86_64"
|
||||
if "%JVM_FLAGS%" == "" set JVM_FLAGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces -Dactivemq.home=$ACTIVEMQ_HOME -Ddata.dir=$ACTIVEMQ_HOME/data -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration="file:%ACTIVEMQ_HOME%\config\logging.properties" -Djava.library.path="%ACTIVEMQ_HOME%/bin/lib/linux-i686:%ACTIVEMQ_HOME%/bin/lib/linux-x86_64"
|
||||
|
||||
if "x%HORNETQ_OPTS%" == "x" goto noHORNETQ_OPTS
|
||||
set JVM_FLAGS=%JVM_FLAGS% %HORNETQ_OPTS%
|
||||
:noHORNETQ_OPTS
|
||||
if "x%ACTIVEMQ_OPTS%" == "x" goto noACTIVEMQ_OPTS
|
||||
set JVM_FLAGS=%JVM_FLAGS% %ACTIVEMQ_OPTS%
|
||||
:noACTIVEMQ_OPTS
|
||||
|
||||
if "x%HORNETQ_DEBUG%" == "x" goto noDEBUG
|
||||
if "x%ACTIVEMQ_DEBUG%" == "x" goto noDEBUG
|
||||
set JVM_FLAGS=%JVM_FLAGS% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
|
||||
:noDEBUG
|
||||
|
||||
if "x%HORNETQ_PROFILE%" == "x" goto noPROFILE
|
||||
if "x%ACTIVEMQ_PROFILE%" == "x" goto noPROFILE
|
||||
set JVM_FLAGS=-agentlib:yjpagent %JVM_FLAGS%
|
||||
:noPROFILE
|
||||
|
||||
rem set JMX_OPTS=-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
|
||||
|
||||
set JVM_FLAGS=%JVM_FLAGS% %JMX_OPTS% -Dhornetq.home="%HORNETQ_HOME%" -classpath "%HORNETQ_HOME%\lib\*"
|
||||
set JVM_FLAGS=%JVM_FLAGS% %JMX_OPTS% -Dactivemq.home="%ACTIVEMQ_HOME%" -classpath "%ACTIVEMQ_HOME%\lib\*"
|
||||
|
||||
"%_JAVACMD%" %JVM_FLAGS% org.apache.activemq.cli.HornetQ %*
|
||||
"%_JAVACMD%" %JVM_FLAGS% org.apache.activemq.cli.ActiveMQ %*
|
||||
|
||||
:END
|
||||
endlocal
|
|
@ -1 +1 @@
|
|||
hornetq.cmd run %*
|
||||
activemq.cmd run %*
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
./hornetq run $@
|
||||
./activemq run $@
|
||||
|
|
|
@ -1 +1 @@
|
|||
hornetq.cmd stop %*
|
||||
activemq.cmd stop %*
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
./hornetq stop $@
|
||||
./activemq stop $@
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
<broker xmlns="http://hornetq.org/schema">
|
||||
|
||||
<core configuration="file:${hornetq.home}/config/clustered/hornetq-configuration.xml"></core>
|
||||
<jms configuration="file:${hornetq.home}/config/clustered/hornetq-jms.xml"></jms>
|
||||
<core configuration="file:${activemq.home}/config/clustered/activemq-configuration.xml"></core>
|
||||
<jms configuration="file:${activemq.home}/config/clustered/activemq-jms.xml"></jms>
|
||||
|
||||
<basic-security/>
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
<broker xmlns="http://hornetq.org/schema">
|
||||
|
||||
<core configuration="file:${hornetq.home}/config/non-clustered/hornetq-configuration.xml"></core>
|
||||
<jms configuration="file:${hornetq.home}/config/non-clustered/hornetq-jms.xml"></jms>
|
||||
<core configuration="file:${activemq.home}/config/non-clustered/activemq-configuration.xml"></core>
|
||||
<jms configuration="file:${activemq.home}/config/non-clustered/activemq-jms.xml"></jms>
|
||||
|
||||
<basic-security/>
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
<broker xmlns="http://hornetq.org/schema">
|
||||
|
||||
<core configuration="file:${hornetq.home}/config/replicated/hornetq-configuration.xml"></core>
|
||||
<jms configuration="file:${hornetq.home}/config/replicated/hornetq-jms.xml"></jms>
|
||||
<core configuration="file:${activemq.home}/config/replicated/activemq-configuration.xml"></core>
|
||||
<jms configuration="file:${activemq.home}/config/replicated/activemq-jms.xml"></jms>
|
||||
|
||||
<basic-security/>
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
<broker xmlns="http://hornetq.org/schema">
|
||||
|
||||
<core configuration="file:${hornetq.home}/config/shared-store/hornetq-configuration.xml"></core>
|
||||
<jms configuration="file:${hornetq.home}/config/shared-store/hornetq-jms.xml"></jms>
|
||||
<core configuration="file:${activemq.home}/config/shared-store/activemq-configuration.xml"></core>
|
||||
<jms configuration="file:${activemq.home}/config/shared-store/activemq-jms.xml"></jms>
|
||||
|
||||
<basic-security/>
|
||||
|
||||
|
|
Loading…
Reference in New Issue