activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1087674 - in /activemq/activemq-apollo/trunk: apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/ apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/ apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/co...
Date Fri, 01 Apr 2011 12:09:01 GMT
Author: chirino
Date: Fri Apr  1 12:09:00 2011
New Revision: 1087674

URL: http://svn.apache.org/viewvc?rev=1087674&view=rev
Log:
Making the sub commands of the apollo and apollo-broker scripts distinct.

Added:
    activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/apollo-broker-commands.index
      - copied, changed from r1087672, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index
    activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/apollo-commands.index
      - copied, changed from r1087672, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index
Removed:
    activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index
Modified:
    activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/Apollo.scala
    activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo
    activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo.cmd

Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/apollo-broker-commands.index
(from r1087672, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/apollo-broker-commands.index?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/apollo-broker-commands.index&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index&r1=1087672&r2=1087674&rev=1087674&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index
(original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/apollo-broker-commands.index
Fri Apr  1 12:09:00 2011
@@ -16,8 +16,6 @@
 ## ---------------------------------------------------------------------------
 org.apache.activemq.apollo.cli.commands.Exit
 org.apache.activemq.apollo.cli.commands.Help
-org.apache.activemq.apollo.cli.commands.Create
-#org.apache.activemq.apollo.cli.commands.Start
 org.apache.activemq.apollo.cli.commands.Stop
 org.apache.activemq.apollo.cli.commands.Run
 org.apache.activemq.apollo.cli.commands.Encrypt

Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/apollo-commands.index
(from r1087672, activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/apollo-commands.index?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/apollo-commands.index&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index&r1=1087672&r2=1087674&rev=1087674&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/commands.index
(original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/META-INF/services/org.apache.activemq.apollo/apollo-commands.index
Fri Apr  1 12:09:00 2011
@@ -17,10 +17,3 @@
 org.apache.activemq.apollo.cli.commands.Exit
 org.apache.activemq.apollo.cli.commands.Help
 org.apache.activemq.apollo.cli.commands.Create
-#org.apache.activemq.apollo.cli.commands.Start
-org.apache.activemq.apollo.cli.commands.Stop
-org.apache.activemq.apollo.cli.commands.Run
-org.apache.activemq.apollo.cli.commands.Encrypt
-org.apache.activemq.apollo.cli.commands.Decrypt
-org.apache.activemq.apollo.cli.commands.StoreExport
-org.apache.activemq.apollo.cli.commands.StoreImport

Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/Apollo.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/Apollo.scala?rev=1087674&r1=1087673&r2=1087674&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/Apollo.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/Apollo.scala
Fri Apr  1 12:09:00 2011
@@ -42,10 +42,18 @@ object Apollo {
   def ANSI(value:Any) =  "\u001B["+value+"m"
   val BOLD =  ANSI(1)
   val RESET = ANSI(0)
-  
-  def print_banner(out: PrintStream) = using(getClass().getResourceAsStream("banner.txt"))
{ source=>
-    copy(source, out)
+
+  var banner_displayed = false
+
+  def print_banner(out: PrintStream) = {
+    if( !banner_displayed ) {
+      using(getClass().getResourceAsStream("banner.txt")) { source=>
+        copy(source, out)
+      }
+      banner_displayed = true
+    }
   }
+
   def print_tips(out: PrintStream) = using(getClass().getResourceAsStream("tips.txt")) {
source=>
     copy(source, out)
   }
@@ -61,13 +69,26 @@ class Apollo extends Main with Action {
 
   var debug = false
 
-  override def getDiscoveryResource = "META-INF/services/org.apache.activemq.apollo/commands.index"
+  val is_apollo_broker = System.getProperty("apollo.base")!=null
+
+  override def getDiscoveryResource = {
+    if( is_apollo_broker ) {
+      "META-INF/services/org.apache.activemq.apollo/apollo-broker-commands.index"
+    } else {
+      "META-INF/services/org.apache.activemq.apollo/apollo-commands.index"
+    }
+
+  }
 
   override def isMultiScopeMode() = false
 
   protected override def createConsole(impl: CommandProcessorImpl, in: InputStream, out:
PrintStream, err: PrintStream, terminal: Terminal)  = {
     new Console(impl, in, out, err, terminal, null) {
-      protected override def getPrompt = BOLD+"apollo> "+RESET
+      protected override def getPrompt = if (is_apollo_broker) {
+        BOLD+"apollo-broker> "+RESET
+      } else {
+        BOLD+"apollo> "+RESET
+      }
       protected override def isPrintStackTraces = debug
       protected override def welcome = {
         print_banner(session.getConsole)

Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala?rev=1087674&r1=1087673&r2=1087674&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
Fri Apr  1 12:09:00 2011
@@ -118,6 +118,18 @@ class Create extends Action {
       val tmp = directory / "tmp"
       log.mkdirs
 
+      val home = new File(System.getProperty("apollo.home"))
+
+      println("Make sure the following directory is on your path: ")
+      println("")
+      println("   %s/bin".format((home / "bin").getCanonicalPath))
+      println("")
+      println("Then run the broker by executing:  ")
+      println("")
+      println("   %s run".format((bin/"apollo-broker").getCanonicalPath))
+      println("")
+
+
     } catch {
       case x:Helper.Failure=>
         println(ansi.a(INTENSITY_BOLD).fg(RED).a("ERROR: ").reset.a(x.getMessage))

Modified: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo?rev=1087674&r1=1087673&r2=1087674&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo (original)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo Fri Apr  1 12:09:00
2011
@@ -88,11 +88,10 @@ if [ ! -x "$JAVACMD" ] ; then
   exit 1
 fi
 
-if [ -z "$APOLLO_BASE" ] ; then
-  APOLLO_BASE="$APOLLO_HOME"
+CLASSPATH=""
+if [ ! -z "$APOLLO_BASE" ] ; then
+  CLASSPATH="${APOLLO_BASE}/etc"
 fi
-
-CLASSPATH=${APOLLO_BASE}/etc
 if [ -d "${APOLLO_HOME}/lib/patches" ] ; then
   for f in "${APOLLO_HOME}/lib/patches"/*.jar; do
     CLASSPATH="$CLASSPATH:$f"
@@ -107,7 +106,9 @@ JUL_CONFIG_FILE="${APOLLO_HOME}/etc/jul.
 # For Cygwin, switch paths to Windows format before running java
 if $cygwin; then
   APOLLO_HOME=`cygpath --windows "$APOLLO_HOME"`
-  APOLLO_BASE=`cygpath --windows "$APOLLO_BASE"`
+  if [ ! -z "$APOLLO_BASE" ] ; then
+    APOLLO_BASE=`cygpath --windows "$APOLLO_BASE"`
+  fi
   JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
   CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
   CYGHOME=`cygpath --windows "$HOME"`
@@ -138,8 +139,13 @@ if [ -z "$JMX_OPTS" ] ; then
 fi
 JVM_FLAGS="${JVM_FLAGS} ${JMX_OPTS}"
 
+SYSTEM_PROPS="-Djava.util.logging.config.file=${JUL_CONFIG_FILE}"
+SYSTEM_PROPS="${SYSTEM_PROPS} -Dapollo.home=${APOLLO_HOME}"
+if [ ! -z "$APOLLO_BASE" ] ; then
+  SYSTEM_PROPS="${SYSTEM_PROPS} -Dapollo.base=${APOLLO_BASE}"
+fi
+
 # Attempt to bump up the ulimit 
 ulimit -n 100000 > /dev/null 2> /dev/null
 
-exec -a apollo "$JAVACMD" ${JVM_FLAGS} -Djava.util.logging.config.file="${JUL_CONFIG_FILE}"
-Dapollo.home="${APOLLO_HOME}" -Dapollo.base="${APOLLO_BASE}" -classpath "${CLASSPATH}" org.apache.activemq.apollo.cli.Apollo
$@
-
+exec -a apollo "$JAVACMD" ${JVM_FLAGS} ${SYSTEM_PROPS} -classpath "${CLASSPATH}" org.apache.activemq.apollo.cli.Apollo
$@

Modified: activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo.cmd
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo.cmd?rev=1087674&r1=1087673&r2=1087674&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo.cmd (original)
+++ activemq/activemq-apollo/trunk/apollo-distro/src/main/release/bin/apollo.cmd Fri Apr 
1 12:09:00 2011
@@ -41,9 +41,8 @@ echo.
 
 :RUN_JAVA
 
-if "%APOLLO_BASE%" == "" set APOLLO_BASE=%APOLLO_HOME%
-
-set CLASSPATH=%APOLLO_BASE%\etc
+set CLASSPATH=
+if NOT "x%APOLLO_BASE%" == "x" set CLASSPATH=%APOLLO_BASE%\etc
 
 rem if not exist "%APOLLO_HOME%\lib\patches" goto NO_LIB_PATCHES
 rem for %%i in ("%APOLLO_HOME%\lib\patches\*.jar") do call :ADD_CLASSPATH %%i
@@ -69,14 +68,14 @@ if "%JMX_OPTS%" == "" set JMX_OPTS=-Dcom
 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%
 
-set JUL_CONFIG_FILE=%APOLLO_BASE%\etc\jul.properties
+set JUL_CONFIG_FILE=%APOLLO_HOME%\etc\jul.properties
+
 
 set JVM_FLAGS=%JVM_FLAGS% -Dapollo.home="%APOLLO_HOME%" 
-set JVM_FLAGS=%JVM_FLAGS% -Dapollo.base="%APOLLO_BASE%"
+if NOT "x%APOLLO_BASE%" == "x" set JVM_FLAGS=%JVM_FLAGS% -Dapollo.base="%APOLLO_BASE%"
 set JVM_FLAGS=%JVM_FLAGS% -Djava.util.logging.config.file="%JUL_CONFIG_FILE%"
 set JVM_FLAGS=%JVM_FLAGS% -classpath "%CLASSPATH%"
 
-rem echo "%_JAVACMD%" %JVM_FLAGS%  org.apache.activemq.apollo.cli.Apollo %*
 "%_JAVACMD%" %JVM_FLAGS%  org.apache.activemq.apollo.cli.Apollo %*
 
 :END



Mime
View raw message