Return-Path: Delivered-To: apmail-incubator-esme-commits-archive@minotaur.apache.org Received: (qmail 30279 invoked from network); 7 Jun 2010 07:19:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Jun 2010 07:19:33 -0000 Received: (qmail 6995 invoked by uid 500); 7 Jun 2010 07:19:33 -0000 Delivered-To: apmail-incubator-esme-commits-archive@incubator.apache.org Received: (qmail 6948 invoked by uid 500); 7 Jun 2010 07:19:32 -0000 Mailing-List: contact esme-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: esme-dev@incubator.apache.org Delivered-To: mailing list esme-commits@incubator.apache.org Received: (qmail 6940 invoked by uid 99); 7 Jun 2010 07:19:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jun 2010 07:19:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jun 2010 07:19:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 51E5423889CB; Mon, 7 Jun 2010 07:19:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r952122 - /incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala Date: Mon, 07 Jun 2010 07:19:08 -0000 To: esme-commits@incubator.apache.org From: rhirsch@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100607071908.51E5423889CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rhirsch Date: Mon Jun 7 07:19:07 2010 New Revision: 952122 URL: http://svn.apache.org/viewvc?rev=952122&view=rev Log: [ESME-59] Better documentation of our existing Scala code Modified: incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.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=952122&r1=952121&r2=952122&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 Mon Jun 7 07:19:07 2010 @@ -179,7 +179,7 @@ class Boot { LiftRules.dispatch.prepend(RestAPI.dispatch) LiftRules.dispatch.append(API2.dispatch) - + // Functionality assocaited with ESME support of twitter api LiftRules.httpAuthProtectedResource.prepend { case Req(TwitterAPI.ApiPath :: _,_,_) => Full(AuthRole("user")) } @@ -198,6 +198,7 @@ class Boot { Stats.makeGauge("users") {Distributor.getUsersCount} Stats.makeGauge("listener") {Distributor.getListenersCount} + // start Scala Actors used in ESME Distributor.touch SchedulerActor.touch MessagePullActor.touch @@ -248,8 +249,11 @@ class Boot { private def makeUtf8(req: HTTPRequest) = {req.setCharacterEncoding("UTF-8")} } +/* +* Set up compass search environment +*/ + object Compass { - // Set up Compass for search val conf = tryo(new CompassConfiguration() .configure(Props.get("compass_config_file") openOr "/props/compass.cfg.xml") .addClass((new Message).clazz)) @@ -260,6 +264,9 @@ object Compass { tryo(c.getSearchEngineIndexManager().createIndex()) } +/* +* Logger to track request times +*/ object RequestAnalyzer { def analyze(req: Box[Req], time: Long, queries: List[(String, Long)]): Unit = { @@ -271,6 +278,9 @@ object RequestAnalyzer { } } +/* +* Logger to dump session info +*/ object SessionInfoDumper extends LiftActor { private var lastTime = millis