Permalink
Browse files

Activator now honors org.jpos.q2.autostart prop

  • Loading branch information...
1 parent 6b7f404 commit bfdaa4cd7d5c537ac805740ad8aaa197ff6f820e @ar ar committed Jul 4, 2014
Showing with 6 additions and 2 deletions.
  1. +5 −2 jpos/src/main/java/org/jpos/q2/Activator.java
  2. +1 −0 qnode/src/dist/bin/qnode
View
7 jpos/src/main/java/org/jpos/q2/Activator.java
@@ -21,16 +21,19 @@
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
+@SuppressWarnings("unused")
public class Activator implements BundleActivator {
Q2 q2;
@Override
public void start(BundleContext context) throws Exception {
- (q2 = new Q2(new String[] {}, context)).start();
+ if ("true".equalsIgnoreCase(context.getProperty("org.jpos.q2.autostart")))
+ (q2 = new Q2(new String[] {}, context)).start();
}
@Override
public void stop(BundleContext context) throws Exception {
- q2.stop();
+ if (q2 != null)
+ q2.stop();
}
}
View
1 qnode/src/dist/bin/qnode
@@ -4,6 +4,7 @@ cd `dirname $0`/.. || exit 1
rm -f deploy/shutdown.xml
java -server \
-Xmx1G \
+ -Dorg.jpos.q2.autostart=true \
-Dcom.sun.management.jmxremote \
-jar @jarname@ "$@"

0 comments on commit bfdaa4c

Please sign in to comment.