activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1032606 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/
Date Mon, 08 Nov 2010 15:39:25 GMT
Author: chirino
Date: Mon Nov  8 15:39:24 2010
New Revision: 1032606

URL: http://svn.apache.org/viewvc?rev=1032606&view=rev
Log:
Improved logging.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Delivery.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocol.scala

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=1032606&r1=1032605&r2=1032606&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  8 15:39:24 2010
@@ -69,10 +69,9 @@ object Connector extends Log {
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class Connector(val broker:Broker, val id:Long) extends BaseService with DispatchLogging
{
+class Connector(val broker:Broker, val id:Long) extends BaseService {
   import Connector._
 
-  override protected def log = Connector
   override val dispatchQueue = broker.dispatchQueue
 
   var config:ConnectorDTO = defaultConfig
@@ -84,15 +83,11 @@ class Connector(val broker:Broker, val i
   val accept_counter = new LongCounter
 
   object BrokerAcceptListener extends TransportAcceptListener {
-    def onAcceptError(error: Exception): Unit = {
-      error.printStackTrace
-      warn("Accept error: " + error)
-      debug("Accept error details: ", error)
+    def onAcceptError(e: Exception): Unit = {
+      log.warn(e, "Error occured while accepting client connection.")
     }
 
     def onAccept(transport: Transport): Unit = {
-      debug("Accepted connection from: %s", transport.getRemoteAddress)
-
       if( protocol!=null ) {
         transport.setProtocolCodec(protocol.createProtocolCodec)
       }
@@ -110,6 +105,7 @@ class Connector(val broker:Broker, val i
       // We release when it gets removed form the connections list.
       connection.dispatchQueue.retain
       connections.put(connection.id, connection)
+      info("Client connected from: %s", connection.transport.getRemoteAddress)
 
       try {
         connection.start()
@@ -162,10 +158,11 @@ class Connector(val broker:Broker, val i
    * Connections callback into the connector when they are stopped so that we can
    * stop tracking them.
    */
-  def stopped(connection:BrokerConnection) = ^{
+  def stopped(connection:BrokerConnection) = dispatchQueue {
     if( connections.remove(connection.id).isDefined ) {
+      info("Client disconnected from: %s", connection.transport.getRemoteAddress)
       connection.dispatchQueue.release
     }
-  } |>>: dispatchQueue
+  }
 
 }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Delivery.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Delivery.scala?rev=1032606&r1=1032605&r2=1032606&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Delivery.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Delivery.scala
Mon Nov  8 15:39:24 2010
@@ -40,7 +40,7 @@ trait DeliveryProducer extends Logging {
 
   def collocate(value:DispatchQueue):Unit = {
     if( value.getTargetQueue ne dispatchQueue.getTargetQueue ) {
-      info(dispatchQueue.getLabel+" co-locating with "+value.getLabel);
+      debug("co-locating %s with %s", dispatchQueue.getLabel, value.getLabel);
       this.dispatchQueue.setTargetQueue(value.getTargetQueue)
     }
   }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala?rev=1032606&r1=1032605&r2=1032606&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
Mon Nov  8 15:39:24 2010
@@ -604,7 +604,7 @@ class Queue(val host: VirtualHost, var i
 
   def collocate(value:DispatchQueue):Unit = {
     if( value.getTargetQueue ne dispatchQueue.getTargetQueue ) {
-      info(dispatchQueue.getLabel+" co-locating with "+value.getLabel);
+      debug("co-locating %s with %s", dispatchQueue.getLabel, value.getLabel);
       this.dispatchQueue.setTargetQueue(value.getTargetQueue)
     }
   }

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocol.scala?rev=1032606&r1=1032605&r2=1032606&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocol.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocol.scala
Mon Nov  8 15:39:24 2010
@@ -374,11 +374,13 @@ class StompProtocolHandler extends Proto
 
   override def onTransportConnected() = {
 
-    session_manager = new SinkMux[StompFrame]( MapSink(connection.transportSink){x=>x},
dispatchQueue, StompFrame)
+    session_manager = new SinkMux[StompFrame]( MapSink(connection.transportSink){x=>
+      trace("sending frame: %s", x)
+      x
+    }, dispatchQueue, StompFrame)
     connection_sink = new OverflowSink(session_manager.open(dispatchQueue));
     connection_sink.refiller = ^{}
     resumeRead
-
   }
 
   override def onTransportDisconnected() = {
@@ -415,9 +417,10 @@ class StompProtocolHandler extends Proto
           // so we know which wire format is being used.
         case frame:StompFrame=>
 
+          trace("received frame: %s", frame)
+
           if( protocol_version == null ) {
 
-            info("got command: %s", frame)
             frame.action match {
               case STOMP =>
                 on_stomp_connect(frame.headers)
@@ -748,7 +751,6 @@ class StompProtocolHandler extends Proto
       return;
     }
 
-    info("subscribing to: %s", destination)
     val binding: BindingDTO = if( topic && !persistent ) {
       null
     } else {
@@ -894,7 +896,7 @@ class StompProtocolHandler extends Proto
   }
 
   private def die(msg:String, explained:String="") = {
-    info("Shutting connection down due to: "+msg)
+    debug("Shutting connection down due to: "+msg)
     _die((MESSAGE_HEADER, ascii(msg))::Nil, explained)
   }
 
@@ -913,7 +915,7 @@ class StompProtocolHandler extends Proto
   override def onTransportFailure(error: IOException) = {
     if( !connection.stopped ) {
       suspendRead("shutdown")
-      info(error, "Shutting connection down due to: %s", error)
+      debug(error, "Shutting connection down due to: %s", error)
       super.onTransportFailure(error);
     }
   }



Mime
View raw message