[jboss-cvs] JBoss Messaging SVN: r7307 - in trunk/src: config/stand-alone/clustered and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jun 11 06:29:58 EDT 2009
Author: ataylor
Date: 2009-06-11 06:29:58 -0400 (Thu, 11 Jun 2009)
New Revision: 7307
Modified:
trunk/src/bin/run.bat
trunk/src/bin/run.sh
trunk/src/bin/stop.bat
trunk/src/bin/stop.sh
trunk/src/config/stand-alone/clustered/jbm-jboss-beans.xml
trunk/src/main/org/jboss/messaging/integration/bootstrap/JBMBootstrapServer.java
Log:
https://jira.jboss.org/jira/browse/JBMESSAGING-1647 - fixed build script and also added better handling obe property substitution
Modified: trunk/src/bin/run.bat
===================================================================
--- trunk/src/bin/run.bat 2009-06-11 08:38:56 UTC (rev 7306)
+++ trunk/src/bin/run.bat 2009-06-11 10:29:58 UTC (rev 7307)
@@ -3,8 +3,11 @@
set JBM_HOME=..
set CONFIG_DIR=%JBM_HOME%\config\stand-alone\non-clustered
set CLASSPATH=%CONFIG_DIR%;%JBM_HOME%\schemas\
-set JVM_ARGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Djava.util.logging.config.file=%CONFIG_DIR%\logging.properties -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.integration.logging.JBMLoggerPlugin -Djava.library.path=.
-REM export JVM_ARGS="-Xmx512M -Djava.util.logging.config.file=%CONFIG_DIR%\logging.properties -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.integration.logging.JBMLoggerPlugin -Djava.library.path=. -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
+set CLUSTER_PROPS=;
+#you can use the following line if you want to run with different ports
+#set CLUSTER_PROPS="-Djnp.port=1099 -Djnp.rmiPort=1098 -Djnp.host=localhost -Djbm.remoting.netty.host=localhost -Djbm.remoting.netty.port=5445"
+set JVM_ARGS=%CLUSTER_PROPS% -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Djbm.config.dir=$CONFIG_DIR -Djava.util.logging.config.file=%CONFIG_DIR%\logging.properties -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.integration.logging.JBMLoggerPlugin -Djava.library.path=.
+REM export JVM_ARGS="-Xmx512M -Djava.util.logging.config.file=%CONFIG_DIR%\logging.properties -Djbm.config.dir=$CONFIG_DIR -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.integration.logging.JBMLoggerPlugin -Djava.library.path=. -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
for /R ..\lib %%A in (*.jar) do (
SET CLASSPATH=!CLASSPATH!;%%A
)
Modified: trunk/src/bin/run.sh
===================================================================
--- trunk/src/bin/run.sh 2009-06-11 08:38:56 UTC (rev 7306)
+++ trunk/src/bin/run.sh 2009-06-11 10:29:58 UTC (rev 7307)
@@ -1,13 +1,16 @@
export JBM_HOME=..
-mkdir logs
+mkdir -p logs
# By default, the server is started in the non-clustered standalone configuration
if [ a"$1" = a ]; then CONFIG_DIR=$JBM_HOME/config/stand-alone/non-clustered; else CONFIG_DIR="$1"; fi
if [ a"$2" = a ]; then FILENAME=jbm-jboss-beans.xml; else FILENAME="$2"; fi
export CLASSPATH=$CONFIG_DIR:$JBM_HOME/schemas/
-export JVM_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Djava.util.logging.config.file=$CONFIG_DIR/logging.properties -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.integration.logging.JBMLoggerPlugin -Djava.library.path=."
-#export JVM_ARGS="-Xmx512M -Djava.util.logging.config.file=$CONFIG_DIR/logging.properties -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.integration.logging.JBMLoggerPlugin -Djava.library.path=. -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
+export CLUSTER_PROPS=;
+#you can use the following line if you want to run with different ports
+#export CLUSTER_PROPS="-Djnp.port=1099 -Djnp.rmiPort=1098 -Djnp.host=localhost -Djbm.remoting.netty.host=localhost -Djbm.remoting.netty.port=5445"
+export JVM_ARGS="$CLUSTER_PROPS -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Djbm.config.dir=$CONFIG_DIR -Djava.util.logging.config.file=$CONFIG_DIR/logging.properties -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.integration.logging.JBMLoggerPlugin -Djava.library.path=."
+#export JVM_ARGS="-Xmx512M -Djava.util.logging.config.file=$CONFIG_DIR/logging.properties -Djbm.config.dir=$CONFIG_DIR -Dorg.jboss.logging.Logger.pluginClass=org.jboss.messaging.integration.logging.JBMLoggerPlugin -Djava.library.path=. -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
for i in `ls $JBM_HOME/lib/*.jar`; do
CLASSPATH=$i:$CLASSPATH
Modified: trunk/src/bin/stop.bat
===================================================================
--- trunk/src/bin/stop.bat 2009-06-11 08:38:56 UTC (rev 7306)
+++ trunk/src/bin/stop.bat 2009-06-11 10:29:58 UTC (rev 7307)
@@ -1 +1,3 @@
-dir >> KILL_ME
\ No newline at end of file
+set JBM_HOME=..
+set CONFIG_DIR=%JBM_HOME%\config\stand-alone\non-clustered
+dir >> %CONFIG_DIR%\STOP_ME
\ No newline at end of file
Modified: trunk/src/bin/stop.sh
===================================================================
--- trunk/src/bin/stop.sh 2009-06-11 08:38:56 UTC (rev 7306)
+++ trunk/src/bin/stop.sh 2009-06-11 10:29:58 UTC (rev 7307)
@@ -1 +1,3 @@
-touch KILL_ME;
\ No newline at end of file
+export JBM_HOME=..
+if [ a"$1" = a ]; then CONFIG_DIR=$JBM_HOME/config/stand-alone/non-clustered; else CONFIG_DIR="$1"; fi
+touch $CONFIG_DIR/STOP_ME;
\ No newline at end of file
Modified: trunk/src/config/stand-alone/clustered/jbm-jboss-beans.xml
===================================================================
--- trunk/src/config/stand-alone/clustered/jbm-jboss-beans.xml 2009-06-11 08:38:56 UTC (rev 7306)
+++ trunk/src/config/stand-alone/clustered/jbm-jboss-beans.xml 2009-06-11 10:29:58 UTC (rev 7307)
@@ -9,10 +9,10 @@
<property name="namingInfo">
<inject bean="Naming"/>
</property>
- <property name="port">${jnp.port}</property>
- <property name="bindAddress">localhost</property>
- <property name="rmiPort">${jnp.rmiPort}</property>
- <property name="rmiBindAddress">localhost</property>
+ <property name="port">${jnp.port:1099}</property>
+ <property name="bindAddress">${jnp.host:localhost}</property>
+ <property name="rmiPort">${jnp.rmiPort:1098}</property>
+ <property name="rmiBindAddress">${jnp.host:localhost}</property>
</bean>
<!-- MBean server -->
Modified: trunk/src/main/org/jboss/messaging/integration/bootstrap/JBMBootstrapServer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/integration/bootstrap/JBMBootstrapServer.java 2009-06-11 08:38:56 UTC (rev 7306)
+++ trunk/src/main/org/jboss/messaging/integration/bootstrap/JBMBootstrapServer.java 2009-06-11 10:29:58 UTC (rev 7307)
@@ -43,24 +43,28 @@
/**
* This is the method in which the JBM server can be deployed externall outside of jBoss. Alternatively a user can embed
* by using the same code as in main
+ *
* @author <a href="ataylor at redhat.com">Andy Taylor</a>
*/
public class JBMBootstrapServer extends BasicBootstrap
{
private static Logger log = Logger.getLogger(JBMBootstrapServer.class);
+
/**
* The deployer
*/
protected BeanXMLDeployer deployer;
+
/**
* The deployments
*/
protected List<KernelDeployment> deployments = new CopyOnWriteArrayList<KernelDeployment>();
+
/**
* The arguments
*/
protected String[] args;
-
+
private Properties properties;
/**
@@ -74,20 +78,20 @@
log.info("Starting JBoss Messaging Server");
final JBMBootstrapServer bootstrap = new JBMBootstrapServer(args);
-
+
bootstrap.run();
-
+
bootstrap.addShutdownHook();
}
-
+
/**
* Add a simple shutdown hook to stop the server.
*/
public void addShutdownHook()
{
- String dirName = System.getProperty("jbm.bootsrap.bin.dir", ".");
- final File file = new File(dirName + "/KILL_ME");
- if(file.exists())
+ String dirName = System.getProperty("jbm.config.dir", ".");
+ final File file = new File(dirName + "/STOP_ME");
+ if (file.exists())
{
file.delete();
}
@@ -97,7 +101,7 @@
@Override
public void run()
{
- if(file.exists())
+ if (file.exists())
{
try
{
@@ -124,7 +128,7 @@
catch (RuntimeException e)
{
log.error("Failed to start server", e);
-
+
throw e;
}
}
@@ -137,18 +141,18 @@
* @param args the arguments
* @throws Exception for any error
*/
- public JBMBootstrapServer(String ... args) throws Exception
+ public JBMBootstrapServer(String... args) throws Exception
{
super();
this.args = args;
}
- public JBMBootstrapServer(KernelConfig kernelConfig, final String ... args) throws Exception
+ public JBMBootstrapServer(KernelConfig kernelConfig, final String... args) throws Exception
{
super(kernelConfig);
this.args = args;
}
-
+
public void bootstrap() throws Throwable
{
super.bootstrap();
@@ -162,7 +166,7 @@
deployer.validate();
}
-
+
/**
* Undeploy a deployment
*
@@ -192,14 +196,14 @@
url = cl.getResource("META-INF/" + arg);
}
//try the system classpath
- if(url == null)
+ if (url == null)
{
url = getClass().getClassLoader().getResource(arg);
}
- if(url == null)
+ if (url == null)
{
File file = new File(arg);
- if(file.exists())
+ if (file.exists())
{
url = file.toURI().toURL();
}
@@ -210,10 +214,9 @@
}
return deploy(url);
}
-
+
/**
* Deploys a XML on the container
- *
*/
public KernelDeployment deploy(final String name, final String xml) throws Throwable
{
@@ -222,16 +225,15 @@
printOut.print(xml);
printOut.flush();
ByteArrayInputStream is = new ByteArrayInputStream(byteOut.toByteArray());
-
+
KernelDeployment deployment = deployer.deploy(name, is);
-
+
deployments.add(deployment);
-
+
return deployment;
}
-
-
+
/**
* Deploy a url
*
@@ -253,7 +255,14 @@
while (iterator.hasPrevious())
{
KernelDeployment deployment = iterator.previous();
- try {undeploy(deployment);} catch (Throwable ignored){}
+ try
+ {
+ undeploy(deployment);
+ }
+ catch (Throwable t)
+ {
+ log.warn("Unable to undeploy: " + deployment.getName(), t);
+ }
}
}
@@ -266,8 +275,8 @@
{
properties = props;
}
-
-
+
+
protected class Shutdown extends Thread
{
public void run()
More information about the jboss-cvs-commits
mailing list