esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r828848 - in /incubator/esme/trunk/server/src: main/scala/bootstrap/liftweb/ main/scala/org/apache/esme/actor/ main/scala/org/apache/esme/api/ main/scala/org/apache/esme/comet/ main/scala/org/apache/esme/external/ main/scala/org/apache/esme...
Date Thu, 22 Oct 2009 20:51:44 GMT
Author: dpp
Date: Thu Oct 22 20:51:42 2009
New Revision: 828848

URL: http://svn.apache.org/viewvc?rev=828848&view=rev
Log:
Upgraded stuff to use Lift Actors for better memory footprints

Modified:
    incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/Distributor.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/HttpSender.scala
    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
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/ScalaInterpreter.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/SchedulerActor.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PublicTimeline.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/TagCloud.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/Feed.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/TwitterFeed.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ActionMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/TrackMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/UserMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AccessPool.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AuthToken.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/DidPerform.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/ExtSession.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/MessageTag.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Privilege.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Relationship.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Tag.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Tracking.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UrlStore.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UserAuth.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UserCryptoSig.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/Style.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TableSorterSnip.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TagDisplay.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/view/UserView.scala
    incubator/esme/trunk/server/src/test/scala/org/apache/esme/lib/MsgParseTest.scala

Modified: incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala Thu Oct 22 20:51:42 2009
@@ -22,6 +22,8 @@
  */
 
 import net.liftweb.util._
+import net.liftweb.common._
+import net.liftweb.actor._
 import net.liftweb.http._
 import net.liftweb.http.auth._
 import net.liftweb.sitemap._
@@ -43,8 +45,6 @@
 import provider.HTTPRequest
 import org.compass.core._
 import org.compass.core.config.CompassConfiguration
-import scala.actors.Actor
-import Actor._
 
 import net.liftweb.widgets.tablesorter._  
 
@@ -163,7 +163,7 @@
     Distributor.touch
     SchedulerActor.touch
     MessagePullActor.touch
-    ScalaInterpreter.touch
+    // ScalaInterpreter.touch
     
     val resentPeriod = Props.getLong("stats.resent.period", 1 week)
     val resentRefreshInterval: Long = Props.getLong("stats.resent.refresh") match {
@@ -291,32 +291,26 @@
   }
 }
 
-object SessionInfoDumper extends Actor {
+object SessionInfoDumper extends LiftActor {
   private var lastTime = millis
 
   val tenMinutes: Long = 10 minutes
-  def act = {
-    link(ActorWatcher)
-    loop {
-      react {
-        case SessionWatcherInfo(sessions) =>
-          if ((millis - tenMinutes) > lastTime) {
-            lastTime = millis
-            val rt = Runtime.getRuntime
-            rt.gc
-
-            val dateStr: String = timeNow.toString
-            Log.info("[MEMDEBUG] At "+dateStr+" Number of open sessions: "+sessions.size)
-            Log.info("[MEMDEBUG] Free Memory: "+pretty(rt.freeMemory))
-            Log.info("[MEMDEBUG] Total Memory: "+pretty(rt.totalMemory))
-          }
+  protected def messageHandler = {
+    case SessionWatcherInfo(sessions) =>
+      if ((millis - tenMinutes) > lastTime) {
+        lastTime = millis
+        val rt = Runtime.getRuntime
+        rt.gc
+	
+        val dateStr: String = timeNow.toString
+        Log.info("[MEMDEBUG] At "+dateStr+" Number of open sessions: "+sessions.size)
+        Log.info("[MEMDEBUG] Free Memory: "+pretty(rt.freeMemory))
+        Log.info("[MEMDEBUG] Total Memory: "+pretty(rt.totalMemory))
       }
-    }
+    
   }
 
   private def pretty(in: Long): String =
   if (in > 1000L) pretty(in / 1000L)+","+(in % 1000L)
   else in.toString
-
-  this.start
 }

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/Distributor.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/Distributor.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/Distributor.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/Distributor.scala Thu Oct 22 20:51:42 2009
@@ -28,26 +28,20 @@
 
 package org.apache.esme.actor
 
-import scala.actors.Actor
-import Actor._
-
 import net.liftweb._
+import actor._
 import http._
 import util._
+import common._
 
 import org.apache.esme._
 import model._
 
 import scala.xml.{Elem}
 
-object Distributor extends Actor {
-  def act = loop {
-    react {
-           case RelinkToActorWatcher =>
-        link(ActorWatcher)
-
+object Distributor extends LiftActor {
+  protected def messageHandler = {
       case StartMeUp =>
-        link(ActorWatcher)
         User.findAll.map(_.id.is).foreach(findOrCreateUser)
 
       case UserCreatedMessage(user, text, tags, when, 
@@ -70,7 +64,7 @@
         findOrCreateUser(user) ! UserActor.Unlisten(who)
 
       case LatestMessages(user, cnt) =>
-        findOrCreateUser(user).forward(UserActor.LatestMessages(cnt))
+        forwardMessageTo(UserActor.LatestMessages(cnt), findOrCreateUser(user))
 
       case m @ UserUpdated(id) =>
         users.get(id).foreach(_ ! m)
@@ -100,7 +94,6 @@
         findOrCreateUser(userId) ! UserActor.Resend(msgId)
 
       case _ =>
-    }
   }
 
   private case object StartMeUp
@@ -112,14 +105,14 @@
                                 replyTo: Box[Long],
                                 pool: Box[Long])
   case class AddMessageToMailbox(user: Long, message: Message, reason: MailboxReason)
-  case class Listen(user: Long, who: Actor)
-  case class Unlisten(user: Long, who: Actor)
+  case class Listen(user: Long, who: LiftActor)
+  case class Unlisten(user: Long, who: LiftActor)
   case class LatestMessages(user: Long, cnt: Int)
   case class NewMessage(msg: Message)
   case class UpdateTrackingFor(user: Long, which: TrackingType)
   case class UserUpdated(userId: Long)
-  case class PublicTimelineListeners(who: Actor)
-  case class PublicTimelineUnlisteners(who: Actor)
+  case class PublicTimelineListeners(who: LiftActor)
+  case class PublicTimelineUnlisteners(who: LiftActor)
   case class AllowUserInPool(userId: Long, poolId: Long)
   case class RefreshUser(userId: Long)
   case class ResendMessage(userId: Long, msgId: Long)
@@ -127,23 +120,20 @@
   case object PerformTrackingType extends TrackingType
   case object TrackTrackingType extends TrackingType
 
-  start
-  this ! StartMeUp
-
   // do nothing
   def touch {
 
   }
 
   private var users: Map[Long, UserActor] = Map.empty
-  private var listeners: List[Actor] = Nil
+  private var listeners: List[LiftActor] = Nil
 
   private def findOrCreateUser(user: Long): UserActor = {
     users.get(user) match {
       case Some(ret) => ret
       case _ =>
         val ret = new UserActor
-        ret.start
+      // ret.start
         ret ! UserActor.StartMeUp(user)
         users = users + (user -> ret)
         ret

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/HttpSender.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/HttpSender.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/HttpSender.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/HttpSender.scala Thu Oct 22 20:51:42 2009
@@ -21,12 +21,11 @@
 
 package org.apache.esme.actor
 
-import scala.actors.Actor
-import Actor._
-
 import net.liftweb._
 import http._
 import util._
+import actor._
+import common._
 import net.liftweb.http.testing._
 
 import org.apache.esme._
@@ -38,18 +37,12 @@
 import methods._
 import java.io.OutputStream
 
-object HttpSender extends Actor with GetPoster {
-  def act = loop {
-    react {
-      case StartMeUp =>
-        link(ActorWatcher)
-        
-
+object HttpSender extends LiftActor with GetPoster {
+  protected def messageHandler = {
       case SendAMessage(action, msg, user, reason, token) =>
         send(action, msg, user, reason, token)
 
       case _ =>
-    }
   }
 
   private case object StartMeUp
@@ -142,8 +135,6 @@
     ret
   }
 
-  start
-  this ! StartMeUp
 
   def baseUrl = ""
 }

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=828848&r1=828847&r2=828848&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 Thu Oct 22 20:51:42 2009
@@ -21,71 +21,36 @@
  * under the License.
  */
 
-import scala.actors.Actor
-import scala.actors.Actor._
-import net.liftweb.http.ActorWatcher
+import net.liftweb._
+import common._
+import actor._
 import org.apache.esme.actor.Distributor.{UserCreatedMessage=>Msg}
 
-class MessagePullActor(val messageProcessor: Actor, private var lastMessage: Option[Msg], val messageSource: UniqueMessageSource) extends Actor {
-
-  import MessagePullActor._
-
-  def act {
-    loop {
-      react {
-        case StartUp => {
-          link(ActorWatcher)
-        }
-        case ByeBye => {
-          unlink(ActorWatcher)
-          self.exit()
-        }
-        case (msgs: List[Msg]) => {
-          val lastMessages = messageSource.getLastSortedMessages(msgs, lastMessage)
-          for (message <- lastMessages) {
-            messageProcessor ! message
-            lastMessage = Some(message)
-          }
-        }
-        case FetchMessages => actor {
-          // "this" used to reference invoking actor
-          this ! messageSource()
-        }
-      }
-    }
-  }
+object MessagePullActor extends LiftActor {
   
-}
-
-object MessagePullActor extends Actor {
-  
-  private var messagePullActors: Map[Any, Actor] = Map()
+  private var messagePullActors: Map[Any, LiftActor] = Map()
   
-  def act = loop {
-    react {
-      case StartPullActor(obj, lastMessage, messageSource) => {
-        if (!messagePullActors.contains(obj)) {
-          val pullActor = new MessagePullActor(Distributor, lastMessage, messageSource)
-          messagePullActors += (obj -> pullActor)
-          pullActor.start
-          pullActor ! StartUp
-        }
+  protected def messageHandler = {
+    case StartPullActor(obj, lastMessage, messageSource) => 
+      if (!messagePullActors.contains(obj)) {
+        val pullActor = new MessagePullActor(Distributor, lastMessage, messageSource)
+        messagePullActors += (obj -> pullActor)
+        pullActor ! StartUp
       }
-      case StopPullActor(obj) => {
-        if (messagePullActors.contains(obj)) {
-          messagePullActors(obj) ! ByeBye
-          messagePullActors -= obj
-        }
-      }
-      case Fetch(obj) => {
-        if (messagePullActors.contains(obj)) {
-          messagePullActors(obj) ! FetchMessages
-        }
+
+    case StopPullActor(obj) => 
+      messagePullActors.get(obj).foreach {
+	pull =>
+	pull ! ByeBye
+        messagePullActors -= obj
       }
-    }
+    
+    case Fetch(obj) => 
+        messagePullActors.get(obj).foreach (
+          _ ! FetchMessages
+        )
   }
 
-  start
 
   // do nothing
   def touch {
@@ -97,7 +62,31 @@
   case class StartPullActor(any: Any, lastMessage: Option[Msg], messageSource: UniqueMessageSource)
   case class StopPullActor(any: Any)
   case class Fetch(any: Any)
-}
+
+
+  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)
+      }
+      
+      case FetchMessages => 
+        this ! messageSource()
+    }
+    
+  }
+}  
+  
+
 
 trait UniqueMessageSource extends (() => List[Msg]) {
   def messageSorter(a: Msg, b: Msg) = a.when < b.when

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=828848&r1=828847&r2=828848&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 Thu Oct 22 20:51:42 2009
@@ -21,97 +21,48 @@
  * under the License.
  */
 
-import scala.actors.Actor
-import scala.actors.TIMEOUT
-import scala.actors.Actor._
 import org.apache.esme.actor.Distributor.AddMessageToMailbox
 import org.apache.esme.model._
 import net.liftweb.http.ActorWatcher
-import net.liftweb.util.{Full,Empty,TimeHelpers}
+import net.liftweb.util._
+import Helpers._
+import net.liftweb.common._
+import net.liftweb.actor._
 
-class PopStatsActor(val period: Long, val refreshInterval: Long) extends Actor {
-
-  import PopStatsActor._
-
-  var queue: List[StatEvent] = List()
-  var stats: Map[Long,Int] = Map()
-  var refreshActor: Actor = _
-  
-  def act {
-    loop {
-      react {
-        case StartUp =>
-          refreshActor = actor {
-            loop {
-              self.reactWithin(refreshInterval) {
-                case TIMEOUT => this ! Expire
-                case ByeBye => self.exit()
-              }
-            }
-          }
-        case ByeBye =>
-          refreshActor ! ByeBye  
-          self.exit()
-        case Hit(id) =>
-          queue += StatEvent(id, now)
-          stats += (id -> (stats.getOrElse(id,0) + 1))
-        case Top(n) =>
-          val topList = stats.toList.sort{
-            case ((_,freq1),(_,freq2)) =>
-              freq2 < freq1
-          }.take(n)
-          reply(topList)
-        case Expire => {
-          queue = queue.dropWhile{ event =>
-            val expired_? = event.when < now
-            if (expired_?) stats -= event.id
-            expired_?
-          }.toList
-        }
-      }
-    }
-  }
-  
-  case class StatEvent(id: Long, when: Long)
-}
-
-object PopStatsActor extends Actor {
+object PopStatsActor extends LiftActor {
 
   // immutable maps of maps doesn't work well
+  // FIXME dpp asks why not?
   import scala.collection.mutable.Map
   
-  val actors: Map[StatParam,Map[Long,PopStatsActor]] = Map()
+  private val actors: Map[StatParam,Map[Long,PopStatsActor]] = Map()
   
-  def now = System.currentTimeMillis
-  def act = loop {
-    react {
-      case StartStats(what, period, refresh) =>
-        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.start
-          statActor ! StartUp
-        }
-          
-      case StopStats(what, period) => // TODO: not used
+  protected def now = System.currentTimeMillis
+  protected def messageHandler = {
+    case StartStats(what, period, refresh) =>
+      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
+    }
+    
+    case StopStats(what, period) => // TODO: not used
       case TopStats(what, n, period) =>
         (for (stat <- actors.get(what);
-             availableActor <- stat.get(period)) yield availableActor) match {
-               case Some(statActor) => statActor forward Top(n)
-               case _ => reply(Nil)
-             }
-      case IncrStats(what, hitItem) =>
-        for (stat <- actors.get(what);
-             statActor <- stat.values)
-          statActor ! Hit(hitItem)
-    }
+              availableActor <- stat.get(period)) yield availableActor) match {
+		case Some(statActor) => forwardMessageTo(Top(n), statActor)
+		case _ => reply(Nil)
+              }
+
+    case IncrStats(what, hitItem) =>
+      for (stat <- actors.get(what);
+           statActor <- stat.values)
+        statActor ! Hit(hitItem)
   }
   
-  start
-
   // do nothing
   def touch {
   }
@@ -126,6 +77,44 @@
   case class StopStats(what: StatParam, period: Long)
   case class TopStats(what: StatParam, n: Byte, period: Long)
   case class IncrStats(what: StatParam, hitItem: Long)
+
+  private class PopStatsActor(period: Long,
+			      refreshInterval: Long) extends LiftActor {
+    private var queue: List[StatEvent] = List()
+    private var stats: Map[Long,Int] = Map()
+    private var running = true
+
+    protected def messageHandler = {
+      case StartUp =>
+
+    case ByeBye =>
+      running = false
+
+    case Hit(id) =>
+      // FIXME this is an O(n) operation.
+      // use LiftBuffer or prepend (using ::)
+      queue += StatEvent(id, now)
+      stats += (id -> (stats.getOrElse(id,0) + 1))
+      
+      case Top(n) =>
+	val topList = stats.toList.sort{
+          case ((_,freq1),(_,freq2)) =>
+            freq2 < freq1
+	}.take(n)
+      reply(topList)
+      
+      case Expire => {
+	queue = queue.dropWhile{ event =>
+          val expired_? = event.when < now
+				if (expired_?) stats -= event.id
+				expired_?
+			      }.toList
+	}
+    }
+    
+    case class StatEvent(id: Long, when: Long)
+  }
+
 }
 
 sealed trait StatParam

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/ScalaInterpreter.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/ScalaInterpreter.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/ScalaInterpreter.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/ScalaInterpreter.scala Thu Oct 22 20:51:42 2009
@@ -25,15 +25,16 @@
 import scala.tools.nsc.Interpreter
 import scala.tools.nsc.Settings
 
-import scala.actors.Actor
-import scala.actors.Actor._
-
 import org.apache.esme.model._
-import net.liftweb.util.{Empty,Props}
-
-object ScalaInterpreter extends Actor{
+import net.liftweb.util._
+import net.liftweb.common._
+import net.liftweb.actor._
+
+/**
+ * dpp commented out for security reasons
+object ScalaInterpreter extends LiftActor {
 
-  val settings = new Settings()
+  private val settings = new Settings()
   val origBootclasspath = settings.bootclasspath.value
   lazy val pathList = List(jarPathOfClass("scala.tools.nsc.Interpreter"),
                            jarPathOfClass("scala.ScalaObject"))
@@ -82,3 +83,4 @@
  
   case class ScalaExcerpt(from: Long, replyTo: Long, pool: Long, code: String)
 }
+*/

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/SchedulerActor.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/SchedulerActor.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/SchedulerActor.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/SchedulerActor.scala Thu Oct 22 20:51:42 2009
@@ -21,88 +21,87 @@
  * under the License.
  */
 
-import scala.actors.Actor
-import scala.actors.TIMEOUT
-import scala.actors.Actor._
+import net.liftweb.actor._
 import org.apache.esme.actor.Distributor.AddMessageToMailbox
 import org.apache.esme.model._
 import net.liftweb.http.ActorWatcher
-import net.liftweb.util.{Full,Empty,TimeHelpers}
-
-class SchedulerActor(val messageProcessor: Actor, val user: Long, val everySeconds: Int, val reason: MailboxReason) extends Actor {
-
-  import SchedulerActor._
-  
-  def act {
-    sendMessage()
-    loop {
-      reactWithin (everySeconds * 1000) {
-        case StartUp => {
-          link(ActorWatcher)
-        }
-        case ByeBye => {
-          unlink(ActorWatcher)
-          self.exit()
-        }
-        case TIMEOUT => {
-          sendMessage()
-        }
+import net.liftweb.util._
+import Helpers._
+import net.liftweb.common._
+
+
+object SchedulerActor extends LiftActor{
+  
+  private var regularsPerAction: Map[Long, List[LiftActor]] = Map()
+  
+  protected def messageHandler = {
+    case StartRegular(action, everySeconds) => {
+      val id = action.id.is
+      val regularActor = new SchedulerActor(Distributor, action.user, everySeconds, RegularReason(id))
+      if (!regularsPerAction.contains(id)) {
+        regularsPerAction += (id -> List(regularActor))
+      } else {
+        regularsPerAction(id) += regularActor
       }
     }
-  }
-  
-  def sendMessage() {
-    val now = System.currentTimeMillis
-    val dateString = TimeHelpers.toInternetDate(now)
-    Message.create.author(user).
-                   when(now).
-                   source("every").
-                   setTextAndTags("Regularly scheduled action: " + dateString, Nil, Empty).
-                   foreach{ msg =>
-                     // Noisy & can't be rejected
-                     // if (msg.save) {
-                       messageProcessor ! Distributor.AddMessageToMailbox(user, msg, reason)
-                     // }
-                   }
-  }
-  
-}
-
-object SchedulerActor extends Actor{
-  
-  private var regularsPerAction: Map[Long, List[Actor]] = Map()
-  
-  def act = loop {
-    react {
-      case StartRegular(action, everySeconds) => {
-        val id = action.id.is
-        val regularActor = new SchedulerActor(Distributor, action.user, everySeconds, RegularReason(id))
-        if (!regularsPerAction.contains(id)) {
-          regularsPerAction += (id -> List(regularActor))
-        } else {
-          regularsPerAction(id) += regularActor
-        }
-        regularActor.start
-        regularActor ! StartUp
-      }
-
-      case StopRegular(id) => {
-        if (regularsPerAction.contains(id)) {
-          for(regularActor <- regularsPerAction(id)) regularActor ! ByeBye
-          regularsPerAction -= id
-        }
+    
+    case StopRegular(id) => {
+      if (regularsPerAction.contains(id)) {
+        for(regularActor <- regularsPerAction(id)) regularActor ! ByeBye
+        regularsPerAction -= id
       }
     }
   }
 
-  start
 
+  private class SchedulerActor(messageProcessor: LiftActor, 
+			       user: Long, 
+			       everySeconds: Int, 
+			       reason: MailboxReason) extends LiftActor {
+    private case object DoItDude
+    private var running = true
+    
+    private def setupPing() {
+      if (running)
+	ActorPing.schedule(this, DoItDude, everySeconds * 1000L)
+    }
+    
+    setupPing()
+    
+    protected def messageHandler: PartialFunction[Any, Unit] = {
+      case DoItDude =>
+	if (running) {
+	  sendMessage()
+	  setupPing()
+	}
+
+      case ByeBye =>
+	running = false
+    }
+      
+    def sendMessage() {
+      val now = System.currentTimeMillis
+      val dateString = TimeHelpers.toInternetDate(now)
+      Message.create.author(user).
+      when(now).
+	source("every").
+      setTextAndTags("Regularly scheduled action: " + dateString, Nil, Empty).
+      foreach{ msg =>
+        // Noisy & can't be rejected
+          // if (msg.save) {
+        messageProcessor ! Distributor.AddMessageToMailbox(user, msg, reason)
+              // }
+            }
+    }
+    
+  }
+  
+  
   // do nothing
   def touch {
   }
   
   case class StartRegular(action: Action, everySeconds: Int)
   case class StopRegular(action: Long)
-  private case object StartUp
   private case object ByeBye
 }

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/actor/UserActor.scala Thu Oct 22 20:51:42 2009
@@ -21,12 +21,11 @@
 
 package org.apache.esme.actor
 
-import scala.actors.{Actor, Exit}
-import Actor._
-
 import net.liftweb._
 import http._
+import actor._
 import util._
+import common._
 import mapper._
 
 import org.apache.esme._
@@ -46,8 +45,8 @@
                                           replyTo: Box[Long],
                                           pool: Box[Long])
   private[actor] case class AddToMailbox(msg: Message, reason: MailboxReason)
-  private[actor] case class Listen(who: Actor)
-  private[actor] case class Unlisten(who: Actor)
+  private[actor] case class Listen(who: LiftActor)
+  private[actor] case class Unlisten(who: LiftActor)
   private[actor] case class LatestMessages(cnt: Int)
   private[actor] case class TestForTracking(msg: Message)
   private[actor] case class UpdateTracking(ttype: Distributor.TrackingType)
@@ -60,14 +59,14 @@
 }
 
 
-class UserActor extends Actor {
+class UserActor extends LiftActor {
   import UserActor._
   
   private var userId: Long = 0
 
   private var userTimezone: TimeZone = _
   
-  private var listeners: List[Actor] = Nil
+  private var listeners: List[LiftActor] = Nil
   
   private var tracking: List[TrackingMatcher] = Nil
 
@@ -83,18 +82,13 @@
 
   private case class RunFunc(f: () => Unit)
 
-  def act = loop {
-    react {
-      case RelinkToActorWatcher =>
-        link(ActorWatcher)
-
+  protected def messageHandler = {
       case m @ Distributor.UserUpdated(_) =>
         User.find(userId).
         foreach(u => userTimezone = TimeZone.getTimeZone(u.timezone))
         listeners.foreach(_ ! m)
 
       case StartMeUp(user) =>
-        link(ActorWatcher)
         userId = user
         User.find(userId).
         foreach(u => userTimezone = TimeZone.getTimeZone(u.timezone))
@@ -213,7 +207,6 @@
             Distributor !
             Distributor.AddMessageToMailbox(id, msg, ResendReason(userId))
         }
-    }
   }
 
   def buildCalendar = userTimezone match {
@@ -268,9 +261,11 @@
               Distributor.AddMessageToMailbox(id, msg, ResendReason(userId))
 
             case FetchFeed(url) => MessagePullActor ! MessagePullActor.Fetch(td.performId)
-            
+
+            /*
             case ScalaInterpret => if (msg.source.is != "scala")
               ScalaInterpreter ! ScalaInterpreter.ScalaExcerpt(userId, msg.id.is, msg.pool.is, msg.getText)
+	      */
 
             case PerformFilter => // IGNORE
           }

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala Thu Oct 22 20:51:42 2009
@@ -30,8 +30,10 @@
 
 import net.liftweb._
 import http._
+import actor._
 import rest._
 import util._
+import common._
 import mapper._
 import Helpers._
 
@@ -40,8 +42,6 @@
 import org.apache.esme.actor._
 
 import scala.xml.{NodeSeq, Text, Elem, XML}
-import scala.actors.Actor
-import Actor._
 
 import scala.collection.mutable.ListBuffer
 import java.util.logging._
@@ -264,19 +264,14 @@
   }
 
   def waitForMsgs(): LiftResponse = {
-    val seq: Long = Helpers.nextNum
-
+    val future = new LAFuture[List[(Message, MailboxReason)]]()
+    
     def waitForAnswer: Box[List[(Message, MailboxReason)]] = 
-    receiveWithin(6L * 60L * 1000L) {
-      case (s2, ret: List[(Message, MailboxReason)]) if s2 == seq =>
-        Full(ret)
-      case (s2, _, _) if s2 != seq => waitForAnswer
-      case _ => Empty
-    }
+      future.get(6L * 60L * 1000L)
 
     var r: Box[NodeSeq] = 
     for (act <- restActor.is ?~ "No REST actor";
-         val ignore = act ! ListenFor(self, 5 minutes, seq);
+         val ignore = act ! ListenFor(future, 5 minutes);
          answer <- waitForAnswer ?~ "Didn't get an answer")
     yield answer.flatMap{ case (msg, reason) => msg.toXml % reason.attr}
 
@@ -406,7 +401,6 @@
   
   private def buildActor(userId: Long): RestActor = {
     val ret = new RestActor
-    ret.start
     ret ! StartUp(userId)
     ret
   }
@@ -416,54 +410,51 @@
   }
   
 
-  class RestActor extends Actor {
+  class RestActor extends LiftActor {
     private var userId: Long = _
     private var msgs: List[(Message, MailboxReason)] = Nil
-    private var listener: Box[(Actor, Long)] = Empty
+    private var listener: Box[LAFuture[List[(Message, MailboxReason)]]] = Empty
     
-    def act = loop {
-      react {
-        case StartUp(userId) =>
-          link(ActorWatcher)
+    protected def messageHandler = {
+      case StartUp(userId) =>
           this.userId = userId
           Distributor ! Distributor.Listen(userId, this)
 
         case ByeBye =>
-          unlink(ActorWatcher)
           Distributor ! Distributor.Unlisten(userId, this)
-          self.exit()
           
-        case UserActor.MessageReceived(msg, reason) =>
-          msgs = (msg, reason) :: msgs
-          listener.foreach {
-            who =>
-            who._1 ! (who._2, msgs)
-            listener = Empty
-            msgs = Nil
-          }
-        
-        case ReleaseListener =>
-          listener.foreach(l => l._1 ! (l._2, Nil))
-          listener = Empty
-
-        case ListenFor(who, len, seq) =>
-          msgs match {
+      case UserActor.MessageReceived(msg, reason) =>
+        msgs = (msg, reason) :: msgs
+      listener.foreach {
+        who =>
+          who.satisfy(msgs)
+        listener = Empty
+        msgs = Nil
+      }
+      
+      case ReleaseListener =>
+        listener.foreach(_.satisfy(Nil))
+      listener = Empty
+      
+      case ListenFor(who, len) =>
+        msgs match {
             case Nil =>
-              listener.foreach(l => l._1 ! (l._2, Nil))
-              listener = Full((who, seq))
+              listener.foreach(_.satisfy(Nil))
+              listener = Full(who)
               ActorPing.schedule(this, ReleaseListener, len)
              
             case xs =>
-              who ! (seq, xs)
+              who.satisfy(xs)
               msgs = Nil
               listener = Empty
-          }
-      }
+        }
     }
   }
 
+
   private case class StartUp(userId: Long)
   private case object ByeBye
-  private case class ListenFor(who: Actor, howLong: TimeSpan, seq: Long)
+  private case class ListenFor(who: LAFuture[List[(Message, MailboxReason)]],
+			       howLong: TimeSpan)
   private case object ReleaseListener
 }

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/TwitterAPI.scala Thu Oct 22 20:51:42 2009
@@ -30,11 +30,13 @@
 
 import net.liftweb._
 import http._
+import actor._
 import auth._
 import js._
 import JE._
 import rest._
 import util._
+import common._
 import mapper._
 import Helpers._
 
@@ -43,8 +45,6 @@
 import org.apache.esme.actor._
 
 import scala.xml._
-import scala.actors.Actor
-import Actor._
 
 import scala.collection.mutable.ListBuffer
 import java.util.logging._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PublicTimeline.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PublicTimeline.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PublicTimeline.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/PublicTimeline.scala Thu Oct 22 20:51:42 2009
@@ -24,6 +24,7 @@
 import net.liftweb.http._
 import net.liftweb.mapper._
 import net.liftweb.util._
+import net.liftweb.common._
 import net.liftweb.util.Helpers._
 import scala.xml._
 import js._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/TagCloud.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/TagCloud.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/TagCloud.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/TagCloud.scala Thu Oct 22 20:51:42 2009
@@ -23,6 +23,7 @@
 
 import net.liftweb.http._
 import net.liftweb.util._
+import net.liftweb.common._
 import net.liftweb.util.Helpers._
 import scala.xml._
 import js._
@@ -45,7 +46,7 @@
     for (user <- User.currentUser) {
       Distributor ! Distributor.Listen(user.id, this)
       Distributor !? (2000, Distributor.LatestMessages(user.id, 40)) match {
-        case Some(msg: List[(Long,MailboxReason,Boolean)]) => messages = msg map {_._1}
+        case Full(msg: List[(Long,MailboxReason,Boolean)]) => messages = msg map {_._1}
         case x =>
       }
     }

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala Thu Oct 22 20:51:42 2009
@@ -23,6 +23,7 @@
 
 import net.liftweb.http._
 import net.liftweb.util._
+import net.liftweb.common._
 import net.liftweb.util.Helpers._
 import scala.xml._
 import js._
@@ -44,7 +45,7 @@
     for (user <- User.currentUser) {
       Distributor ! Distributor.Listen(user.id, this)
       Distributor !? (2000, Distributor.LatestMessages(user.id, 40)) match {
-        case Some(msg: List[(Long,MailboxReason,Boolean)]) => messages = msg
+        case Full(msg: List[(Long,MailboxReason,Boolean)]) => messages = msg
         case x =>
       }
     }

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/Feed.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/Feed.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/Feed.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/Feed.scala Thu Oct 22 20:51:42 2009
@@ -34,6 +34,7 @@
 import org.apache.esme.actor.Distributor.UserCreatedMessage
 
 import net.liftweb.util._
+import net.liftweb.common._
 
 abstract class Feed(val user: User, val url: String, val source: String, val truncateChars: Int, val tags: List[String]) extends UniqueMessageSource {
   // import java.net.{URLConnection, URL}

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala Thu Oct 22 20:51:42 2009
@@ -28,7 +28,7 @@
 import org.apache.esme.model.Message
 import org.apache.esme.actor.Distributor.{UserCreatedMessage=>Msg}
 
-import net.liftweb.util.Empty
+import net.liftweb.common.Empty
 
 object RssFeed {
   val dateFormats = List(new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", US))

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/TwitterFeed.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/TwitterFeed.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/TwitterFeed.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/TwitterFeed.scala Thu Oct 22 20:51:42 2009
@@ -27,6 +27,7 @@
 
 import net.liftweb._
 import util._
+import common._
 
 object TwitterFeed {
   val UserTimelineUrl = "http://twitter.com/statuses/user_timeline/"

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala Thu Oct 22 20:51:42 2009
@@ -34,6 +34,7 @@
 import mapper._
 
 import util._
+import common._
 import Helpers._
 
 import model._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ActionMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ActionMgr.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ActionMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ActionMgr.scala Thu Oct 22 20:51:42 2009
@@ -34,6 +34,7 @@
 import mapper._
 
 import util._
+import common._
 import Helpers._
 
 import model._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala Thu Oct 22 20:51:42 2009
@@ -34,6 +34,7 @@
 import mapper._
 
 import util._
+import common._
 import Helpers._
 
 import model._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/ConversationMgr.scala Thu Oct 22 20:51:42 2009
@@ -34,6 +34,7 @@
 import mapper._
 
 import util._
+import common._
 import Helpers._
 
 import model._
@@ -71,4 +72,4 @@
 
   }
 
-}
\ No newline at end of file
+}

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/MsgParser.scala Thu Oct 22 20:51:42 2009
@@ -26,9 +26,10 @@
 import scala.util.matching._
 import net.liftweb._
 import util._
+import common._
 import mapper._
 import Helpers._
-import net.liftweb.util.{Failure => BoxFailure}
+import net.liftweb.common.{Failure => BoxFailure}
 import scala.util.parsing.input.Reader
 import scala.xml.{XML, NodeSeq, Node, Text}
 import org.apache.esme._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala Thu Oct 22 20:51:42 2009
@@ -34,6 +34,7 @@
 import mapper._
 
 import util._
+import common._
 import Helpers._
 
 import model._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/TrackMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/TrackMgr.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/TrackMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/TrackMgr.scala Thu Oct 22 20:51:42 2009
@@ -34,6 +34,7 @@
 import mapper._
 
 import util._
+import common._
 import Helpers._
 
 import model._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/UserMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/UserMgr.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/UserMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/UserMgr.scala Thu Oct 22 20:51:42 2009
@@ -34,6 +34,7 @@
 import Loc._
 import mapper._
 import util._
+import common._
 import Helpers._
 import model._
 import org.apache.esme.model.{Message, User}

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AccessPool.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AccessPool.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AccessPool.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AccessPool.scala Thu Oct 22 20:51:42 2009
@@ -25,6 +25,7 @@
 import mapper._
 import http._
 import util._
+import common._
 
 import scala.xml.Text
 

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Action.scala Thu Oct 22 20:51:42 2009
@@ -25,6 +25,7 @@
 import mapper._
 import http._
 import util._
+import common._
 
 import org.apache.esme._
 import lib._
@@ -256,11 +257,11 @@
   def setTest(in: String): Box[Action] = try {
     testExpr(in) match {
       case Success(v, _) => Full(this.theTest(v.toStr))
-      case Failure(m, _) => net.liftweb.util.Failure(m, Empty, Empty)
-      case Error(m, _) => net.liftweb.util.Failure(m, Empty, Empty)
+      case Failure(m, _) => net.liftweb.common.Failure(m, Empty, Empty)
+      case Error(m, _) => net.liftweb.common.Failure(m, Empty, Empty)
     }
   } catch {
-    case e: Exception => net.liftweb.util.Failure(e.getMessage, Empty, Empty)
+    case e: Exception => net.liftweb.common.Failure(e.getMessage, Empty, Empty)
   }
 
   def testText = theTest.is
@@ -274,8 +275,8 @@
   
   def setAction(in: String): Box[Action] = _perform(in) match {
     case Success(_, _) => Full(this.theAction(in))
-    case Failure(m, _) => net.liftweb.util.Failure(m, Empty, Empty)
-    case Error(m, _) => net.liftweb.util.Failure(m, Empty, Empty)
+    case Failure(m, _) => net.liftweb.common.Failure(m, Empty, Empty)
+    case Error(m, _) => net.liftweb.common.Failure(m, Empty, Empty)
   }
 
 

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AuthToken.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AuthToken.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AuthToken.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/AuthToken.scala Thu Oct 22 20:51:42 2009
@@ -25,6 +25,7 @@
 import mapper._
 import http._
 import util._
+import common._
 
 import org.apache.esme._
 import lib._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/DidPerform.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/DidPerform.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/DidPerform.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/DidPerform.scala Thu Oct 22 20:51:42 2009
@@ -24,6 +24,7 @@
 import net.liftweb._
 import mapper._
 import util._
+import common._
 
 import scala.xml._
 

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/ExtSession.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/ExtSession.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/ExtSession.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/ExtSession.scala Thu Oct 22 20:51:42 2009
@@ -24,6 +24,7 @@
 import net.liftweb._
 import mapper._
 import util._
+import common._
 
 object ExtSession extends ExtSession with MetaProtoExtendedSession[ExtSession] {
   override def dbTableName = "ext_session" // define the DB table name

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Mailbox.scala Thu Oct 22 20:51:42 2009
@@ -24,6 +24,7 @@
 import net.liftweb._
 import mapper._
 import util._
+import common._
 import net.liftweb.http.js.JE._
 import net.liftweb.http.js.JsExp
 

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Message.scala Thu Oct 22 20:51:42 2009
@@ -24,6 +24,7 @@
 import net.liftweb._
 import mapper._
 import util._
+import common._
 import http.js._
 import Helpers._
 import java.util.logging._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/MessageTag.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/MessageTag.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/MessageTag.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/MessageTag.scala Thu Oct 22 20:51:42 2009
@@ -24,6 +24,7 @@
 import net.liftweb._
 import mapper._
 import util._
+import common._
 import Helpers._
 
 object MessageTag extends MessageTag with LongKeyedMetaMapper[MessageTag] {

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Privilege.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Privilege.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Privilege.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Privilege.scala Thu Oct 22 20:51:42 2009
@@ -34,6 +34,7 @@
 import mapper._
 
 import util._
+import common._
 import Helpers._
 
 import model._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Relationship.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Relationship.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Relationship.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Relationship.scala Thu Oct 22 20:51:42 2009
@@ -24,6 +24,7 @@
 import net.liftweb._
 import mapper._
 import util._
+import common._
 
 object Relationship extends Relationship with LongKeyedMetaMapper[Relationship] {
 

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Tag.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Tag.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Tag.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Tag.scala Thu Oct 22 20:51:42 2009
@@ -25,14 +25,13 @@
 import http._
 import mapper._
 import util._
+import actor._
+import common._
 import Helpers._
 
 import scala.collection.mutable.HashMap
 import java.util.logging._
 
-import scala.actors._
-import Actor._
-
 import org.apache.esme.lib.TagUtils
 
 object Tag extends Tag with MetaProtoTag[Tag] {
@@ -43,7 +42,7 @@
   val logger: Logger = Logger.getLogger("org.apache.esme.model")
   logger.setLevel(Level.WARNING);
   
-  private var listeners: List[Actor] = Nil
+  private var listeners: List[LiftActor] = Nil
   private var cloud: List[(String, Float)] = Nil
 
   // Compounds a bunch of (String, Int) elements so that [(String1, Int1), (String1, Int2)] becomes [(String1, Int1+Int2)]

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Tracking.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Tracking.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Tracking.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/Tracking.scala Thu Oct 22 20:51:42 2009
@@ -24,6 +24,7 @@
 import net.liftweb._
 import mapper._
 import util._
+import common._
 import Helpers._
 import http._
 

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UrlStore.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UrlStore.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UrlStore.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UrlStore.scala Thu Oct 22 20:51:42 2009
@@ -24,6 +24,7 @@
 import net.liftweb._
 import mapper._
 import util._
+import common._
 import http._
 
 import org.apache.esme.actor.PopStatsActor

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/User.scala Thu Oct 22 20:51:42 2009
@@ -27,6 +27,7 @@
 
 import sitemap._
 import util._
+import common._
 import openid._
 import http._
 import js._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UserAuth.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UserAuth.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UserAuth.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UserAuth.scala Thu Oct 22 20:51:42 2009
@@ -25,6 +25,7 @@
 import mapper._
 import openid._
 import util._
+import common._
 import Helpers._
 import http._
 

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UserCryptoSig.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UserCryptoSig.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UserCryptoSig.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/model/UserCryptoSig.scala Thu Oct 22 20:51:42 2009
@@ -24,6 +24,7 @@
 import net.liftweb._
 import mapper._
 import util._
+import common._
 import Helpers._
 
 import java.security._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/Style.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/Style.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/Style.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/Style.scala Thu Oct 22 20:51:42 2009
@@ -24,6 +24,7 @@
 import net.liftweb._
 import http._
 import util._
+import common._
 import js._
 import JE._
 import JsCmds._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TableSorterSnip.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TableSorterSnip.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TableSorterSnip.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TableSorterSnip.scala Thu Oct 22 20:51:42 2009
@@ -29,6 +29,7 @@
 import JsCmds._
 import JE._
 import util._
+import common._
 import Helpers._
 import scala.xml.{NodeSeq, Unparsed}
 
@@ -36,4 +37,4 @@
 
 class TableSorterSnip {
 def render(xhtml: NodeSeq): NodeSeq = TableSorter("esme-table")
-}
\ No newline at end of file
+}

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TagDisplay.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TagDisplay.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TagDisplay.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/TagDisplay.scala Thu Oct 22 20:51:42 2009
@@ -32,6 +32,7 @@
 import JsCmds._
 import JE._
 import util._
+import common._
 import Helpers._
 
 import mapper._

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/snippet/UserSnip.scala Thu Oct 22 20:51:42 2009
@@ -31,6 +31,7 @@
 import JsCmds._
 import JE._
 import util._
+import common._
 import Helpers._
 import TimeHelpers.intToTimeSpanBuilder
 import TimeHelpers.timeSpanToLong

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/view/UserView.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/view/UserView.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/view/UserView.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/view/UserView.scala Thu Oct 22 20:51:42 2009
@@ -28,6 +28,7 @@
 import JsCmds._
 import SHtml._
 import util._
+import common._
 import Helpers._
 import sitemap._
 import mapper._

Modified: incubator/esme/trunk/server/src/test/scala/org/apache/esme/lib/MsgParseTest.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/test/scala/org/apache/esme/lib/MsgParseTest.scala?rev=828848&r1=828847&r2=828848&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/test/scala/org/apache/esme/lib/MsgParseTest.scala (original)
+++ incubator/esme/trunk/server/src/test/scala/org/apache/esme/lib/MsgParseTest.scala Thu Oct 22 20:51:42 2009
@@ -25,6 +25,7 @@
 import org.specs.runner.JUnit3
 import org.specs.runner.ConsoleRunner
 import net.liftweb.util._
+import net.liftweb.common._
 import org.specs.matcher._
 import Helpers._
 import MsgParser._



Mime
View raw message