You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2010/11/29 20:53:13 UTC
svn commit: r1040254 - in /activemq/activemq-apollo/trunk:
apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/
apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/
apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/...
Author: chirino
Date: Mon Nov 29 19:53:12 2010
New Revision: 1040254
URL: http://svn.apache.org/viewvc?rev=1040254&view=rev
Log:
Nicer startup logging.
Added:
activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/tips.txt
- copied, changed from r1040194, activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/banner.txt
Modified:
activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/BDBStore.scala
activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStore.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/banner.txt
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml
activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/log4j.properties
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-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/store/hawtdb/HawtDBStore.scala
Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/BDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/BDBStore.scala?rev=1040254&r1=1040253&r2=1040254&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/BDBStore.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/store/bdb/BDBStore.scala Mon Nov 29 19:53:12 2010
@@ -102,6 +102,7 @@ class BDBStore extends DelayingStoreSupp
}
protected def _start(onCompleted: Runnable) = {
+ info("Starting bdb store at: '%s'", config.directory)
executor_pool = Executors.newFixedThreadPool(1, new ThreadFactory(){
def newThread(r: Runnable) = {
val rc = new Thread(r, toString+" io")
@@ -122,6 +123,7 @@ class BDBStore extends DelayingStoreSupp
protected def _stop(onCompleted: Runnable) = {
new Thread() {
override def run = {
+ info("Stopping BDB store at: '%s'", config.directory)
executor_pool.shutdown
executor_pool.awaitTermination(86400, TimeUnit.SECONDS)
executor_pool = null
Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala?rev=1040254&r1=1040253&r2=1040254&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala Mon Nov 29 19:53:12 2010
@@ -153,12 +153,16 @@ class Connector(val broker:Broker, val i
if( transportServer.isInstanceOf[KeyManagerAware] && broker.key_storage!=null ) {
transportServer.asInstanceOf[KeyManagerAware].setKeyManagers(broker.key_storage.create_key_managers)
}
- transportServer.start(onCompleted)
+ transportServer.start(^{
+ info("Accepting connections at: "+config.bind)
+ onCompleted.run
+ })
}
override def _stop(onCompleted:Runnable): Unit = {
transportServer.stop(^{
+ info("Stopped connector at: "+config.bind)
val tracker = new LoggingTracker(toString, dispatchQueue)
connections.valuesIterator.foreach { connection=>
tracker.stop(connection)
Modified: activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStore.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStore.scala?rev=1040254&r1=1040253&r2=1040254&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStore.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/main/scala/org/apache/activemq/apollo/store/cassandra/CassandraStore.scala Mon Nov 29 19:53:12 2010
@@ -107,6 +107,7 @@ class CassandraStore extends DelayingSto
}
protected def _start(onCompleted: Runnable) = {
+ info("Starting cassandra store at: '%s'", config.hosts.toList.mkString(", "))
blocking = Executors.newFixedThreadPool(20, new ThreadFactory(){
def newThread(r: Runnable) = {
val rc = new Thread(r, "cassandra client")
@@ -133,6 +134,7 @@ class CassandraStore extends DelayingSto
}
protected def _stop(onCompleted: Runnable) = {
+ info("Stopping cassandra store at: '%s'", config.hosts.toList.mkString(", "))
blocking.shutdown
new Thread("casandra client shutdown") {
override def run = {
Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/banner.txt
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/banner.txt?rev=1040254&r1=1040253&r2=1040254&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/banner.txt (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/banner.txt Mon Nov 29 19:53:12 2010
@@ -1,6 +1,9 @@
-[1mApache Apollo[0m (${project.version})
-Hit '[1m<tab>[0m' for a list of available commands
- and '[1m[cmd] --help[0m' for help on a specific command.
-Run '[1mexit[0m' to exit the shell.
+[4C[0;1m_____[16C.__ .__
+ / [32m_ \ [37m______ ____ | [32m| [37m| [32m| [37m____
+ / [32m/[37m_\ [32m\[37m\[32m____ \ [37m/ [32m_ \[37m| [32m| [37m| [32m| [37m/ [32m_ \
+ [37m/ | [32m\ |[37m_> [32m> <[37m_> [32m) |[37m_| [32m|[37m_( [32m<[37m_> [32m)
+ \____[37m|[32m__ / __/ \____/[37m|[32m____/____/[37m\[32m____/
+[9C\/[37m|[32m__| [37mApache Apollo[0m (${project.version})
+
Copied: activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/tips.txt (from r1040194, activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/banner.txt)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/tips.txt?p2=activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/tips.txt&p1=activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/banner.txt&r1=1040194&r2=1040254&rev=1040254&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/banner.txt (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/filtered-resources/org/apache/activemq/apollo/cli/tips.txt Mon Nov 29 19:53:12 2010
@@ -1,5 +1,3 @@
-[1mApache Apollo[0m (${project.version})
-
Hit '[1m<tab>[0m' for a list of available commands
and '[1m[cmd] --help[0m' for help on a specific command.
Run '[1mexit[0m' to exit the shell.
Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml?rev=1040254&r1=1040253&r2=1040254&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/apollo-ssl.xml Mon Nov 29 19:53:12 2010
@@ -15,7 +15,7 @@
-->
<broker id="default" rev="1" xmlns="http://activemq.apache.org/schema/activemq/apollo">
<notes>
- The default configuration.
+ The default configuration with tls/ssl enabled.
</notes>
<virtual-host id="default" auto-create-queues="true" >
Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/log4j.properties?rev=1040254&r1=1040253&r2=1040254&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/log4j.properties (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/resources/org/apache/activemq/apollo/cli/commands/etc/log4j.properties Mon Nov 29 19:53:12 2010
@@ -33,7 +33,7 @@ log4j.logger.org.apache.activemq.apollo=
# Console Settings
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%-5p | %t | %m%n
+log4j.appender.console.layout.ConversionPattern=%-5p | %m%n
log4j.appender.console.threshold=INFO
# File Settings
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=1040254&r1=1040253&r2=1040254&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 Mon Nov 29 19:53:12 2010
@@ -42,6 +42,14 @@ 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)
+ }
+ def print_tips(out: PrintStream) = using(getClass().getResourceAsStream("tips.txt")) { source=>
+ copy(source, out)
+ }
+
}
@command(scope="apollo", name = "apollo", description = "The Apollo Command line tool")
@@ -63,14 +71,15 @@ class Apollo extends Main with Action {
protected override def getPrompt = BOLD+"apollo> "+RESET
protected override def isPrintStackTraces = debug
protected override def welcome = {
- using(getClass().getResourceAsStream("banner.txt")) {source=>
- copy(source, session.getConsole())
- }
+ print_banner(session.getConsole)
+ print_tips(session.getConsole)
}
protected override def setSessionProperties = {}
}
}
+
+
@argument(name = "args", description = "apollo sub command arguments", multiValued=true)
var args = Array[String]()
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=1040254&r1=1040253&r2=1040254&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 Mon Nov 29 19:53:12 2010
@@ -51,6 +51,7 @@ class Create extends Action {
def println(value:Any) = session.getConsole.println(value)
try {
+ println("Creating apollo instance at: %s".format(directory))
val bin = directory / "bin"
bin.mkdirs
@@ -62,6 +63,7 @@ class Create extends Action {
write("etc/log4j.properties", target)
// Generate a keystore with a new key
+ println("Generating ssl keystore...")
val ssl = system(etc, Array(
"keytool", "-genkey",
"-storetype", "JKS",
@@ -78,6 +80,7 @@ class Create extends Action {
if( ssl ) {
write("etc/apollo-ssl.xml", target)
} else {
+ println("WARNNIG: Could not generate the keystore, make sure the keytool command is in your PATH")
write("etc/apollo.xml", target)
}
Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala?rev=1040254&r1=1040253&r2=1040254&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala Mon Nov 29 19:53:12 2010
@@ -35,6 +35,7 @@ import Helper._
import org.apache.activemq.apollo.util.{Logging, ServiceControl}
import org.apache.activemq.apollo.util.FileSupport._
import org.apache.activemq.apollo.util.OptionSupport._
+import org.apache.activemq.apollo.cli.Apollo
/**
* The apollo create command
@@ -84,10 +85,10 @@ class Run extends Action with Logging {
tmp.mkdirs
}
- info("Apollo Broker Service Starting");
+ Apollo.print_banner(session.getConsole)
// Load the configs and start the brokers up.
- info("Loading configurations from '%s'.", conf);
+ info("Loading configuration file '%s'.", conf);
val store = new FileConfigStore
store.file = conf
ConfigStore() = store
@@ -97,12 +98,12 @@ class Run extends Action with Logging {
store.getBroker(id, true).foreach{ config=>
// Only start the broker up if it's enabled..
if( config.enabled.getOrElse(true) ) {
- info("Starting broker '%s'...".format(config.id));
+ debug("Starting broker '%s'", config.id);
val broker = new Broker()
broker.config = config
BrokerRegistry.add(config.id, broker)
broker.start(^{
- info("Broker '%s' started.".format(config.id));
+ info("Broker '%s' started", config.id);
})
}
}
@@ -112,7 +113,7 @@ class Run extends Action with Logging {
// Start up the admin interface...
- info("Starting administration interface...");
+ debug("Starting administration interface");
var server = new Server
var connector = new SelectChannelConnector
Modified: activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/store/hawtdb/HawtDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/store/hawtdb/HawtDBStore.scala?rev=1040254&r1=1040253&r2=1040254&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/store/hawtdb/HawtDBStore.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/store/hawtdb/HawtDBStore.scala Mon Nov 29 19:53:12 2010
@@ -104,6 +104,7 @@ class HawtDBStore extends DelayingStoreS
}
protected def _start(onCompleted: Runnable) = {
+ info("Starting hawtdb store at: '%s'", config.directory)
executor_pool = Executors.newFixedThreadPool(1, new ThreadFactory(){
def newThread(r: Runnable) = {
val rc = new Thread(r, "hawtdb store client")
@@ -151,6 +152,7 @@ class HawtDBStore extends DelayingStoreS
}
protected def _stop(onCompleted: Runnable) = {
+ info("Stopping hawtdb store at: '%s'", config.directory)
schedule_version.incrementAndGet
new Thread() {
override def run = {