esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r884337 - in /incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor: MessagePullActor.scala PopStatsActor.scala
Date Wed, 25 Nov 2009 23:24:12 GMT
Author: vdichev
Date: Wed Nov 25 23:24:12 2009
New Revision: 884337

URL: http://svn.apache.org/viewvc?rev=884337&view=rev
Log:
Format indentation

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/MessagePullActor.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/PopStatsActor.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/MessagePullActor.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/MessagePullActor.scala?rev=884337&r1=884336&r2=884337&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/MessagePullActor.scala
(original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/MessagePullActor.scala
Wed Nov 25 23:24:12 2009
@@ -40,16 +40,15 @@
       }
 
     case StopPullActor(obj) => 
-      messagePullActors.get(obj).foreach {
-	pull =>
-	pull ! ByeBye
+      messagePullActors.get(obj).foreach { pull =>
+        pull ! ByeBye
         messagePullActors -= obj
       }
     
     case Fetch(obj) => 
-        messagePullActors.get(obj).foreach (
-          _ ! FetchMessages
-        )
+      messagePullActors.get(obj).foreach (
+        _ ! FetchMessages
+      )
   }
 
 
@@ -65,21 +64,23 @@
   case class Fetch(any: Any)
 
 
-  private class MessagePullActor(messageProcessor: LiftActor, 
-			 private var lastMessage: Option[Msg],
-			 messageSource: UniqueMessageSource) extends LiftActor {
+  private class MessagePullActor(
+    messageProcessor: LiftActor, 
+    private var lastMessage: Option[Msg],
+    messageSource: UniqueMessageSource) extends LiftActor {
+      
     protected def messageHandler = {
       case StartUp => 
-	
-	case ByeBye => 
-	  
-          case (msgs: List[Msg]) => 
-            val lastMessages = messageSource.getLastSortedMessages(msgs, lastMessage)
-      for (message <- lastMessages) {
-        messageProcessor ! message
-        lastMessage = Some(message)
-        Stats incr "messagesPulled"
-      }
+        
+      case ByeBye => 
+          
+      case (msgs: List[Msg]) => 
+        val lastMessages = messageSource.getLastSortedMessages(msgs, lastMessage)
+        for (message <- lastMessages) {
+          messageProcessor ! message
+          lastMessage = Some(message)
+          Stats incr "messagesPulled"
+        }
       
       case FetchMessages => 
         this ! messageSource()

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/PopStatsActor.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/PopStatsActor.scala?rev=884337&r1=884336&r2=884337&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/PopStatsActor.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/PopStatsActor.scala Wed
Nov 25 23:24:12 2009
@@ -38,14 +38,15 @@
   protected def now = System.currentTimeMillis
   protected def messageHandler = {
     case StartStats(what, period, refresh) =>
-      if (!actors.contains(what))
+      if (!actors.contains(what)) {
         actors(what) = Map()
-    val stat = actors(what)
-    if(!stat.contains(period)) {
-      val statActor = new PopStatsActor(period, refresh)
-      stat(period) = statActor
-      statActor ! StartUp
-    }
+      }
+      val stat = actors(what)
+      if(!stat.contains(period)) {
+        val statActor = new PopStatsActor(period, refresh)
+        stat(period) = statActor
+        statActor ! StartUp
+      }
     
     case StopStats(what, period) => // TODO: not used
     case TopStats(what, n, period) =>



Mime
View raw message