incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhir...@apache.org
Subject svn commit: r952273 - in /incubator/esme/trunk/server: ./ src/main/resources/props/ src/main/scala/bootstrap/liftweb/ src/main/scala/org/apache/esme/actor/ src/main/scala/org/apache/esme/model/
Date Mon, 07 Jun 2010 15:31:51 GMT
Author: rhirsch
Date: Mon Jun  7 15:31:50 2010
New Revision: 952273

URL: http://svn.apache.org/viewvc?rev=952273&view=rev
Log:
[ESME-161] Move the existing JMX interface to Ostrich
Patch by Imtiaz Ahmed Hajee Esmail 

Modified:
    incubator/esme/trunk/server/pom.xml
    incubator/esme/trunk/server/src/main/resources/props/default.props
    incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.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/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/model/User.scala

Modified: incubator/esme/trunk/server/pom.xml
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/pom.xml?rev=952273&r1=952272&r2=952273&view=diff
==============================================================================
--- incubator/esme/trunk/server/pom.xml (original)
+++ incubator/esme/trunk/server/pom.xml Mon Jun  7 15:31:50 2010
@@ -105,11 +105,11 @@
             <name>Compass</name>
             <url>http://repo.compass-project.org</url>
         </repository>
-         <repository>
+         <!--repository>
             <id>scala-stats</id>
             <name>Twitter Repo</name>
             <url>http://www.lag.net/nest</url>
-        </repository>
+        </repository-->
          <repository>
                <id>Configgy</id>
               <name>http://www.lag.net/repo</name>
@@ -242,10 +242,15 @@
             <artifactId>lucene-snowball</artifactId>
             <version>${lucene.version}</version>
         </dependency>
-        <dependency>
+        <!--dependency>
             <groupId>com.twitter</groupId>
             <artifactId>stats</artifactId>
             <version>${scala.stats.version}</version>
+        </dependency-->
+        <dependency>
+            <groupId>com.twitter</groupId>
+            <artifactId>ostrich</artifactId>
+            <version>1.1.16</version>
         </dependency>
         <dependency>
             <groupId>org.scala-tools.testing</groupId>

Modified: incubator/esme/trunk/server/src/main/resources/props/default.props
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/resources/props/default.props?rev=952273&r1=952272&r2=952273&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/resources/props/default.props (original)
+++ incubator/esme/trunk/server/src/main/resources/props/default.props Mon Jun  7 15:31:50
2010
@@ -15,4 +15,12 @@
  * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
- */
\ No newline at end of file
+*/
+
+;Enable JMX
+jmx.enable=true
+; These ports can't be the same as the default ports for ESME (which is if starting by jetty
(like in jetty:run) - 8080)
+;Enable and set port for socket access (text output) (Ostrich)
+admin_text_port=9989
+;Enable and set port for web access (JSON output) (Ostrich)
+admin_http_port=8087

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=952273&r1=952272&r2=952273&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 15:31:50
2010
@@ -45,7 +45,9 @@ import org.compass.core._
 import org.compass.core.config.CompassConfiguration
 
 import net.liftweb.widgets.tablesorter._
-import com.twitter.stats._
+//import com.twitter.stats._
+import com.twitter.ostrich.{ServiceTracker, Stats, StatsMBean}
+import net.lag.configgy.{RuntimeEnvironment, Config}
 
 /**
  * A class that's instantiated early and run.  It allows the application
@@ -198,6 +200,12 @@ class Boot {
     Stats.makeGauge("users") {Distributor.getUsersCount}
     Stats.makeGauge("listener") {Distributor.getListenersCount}
 
+    val runtime = new RuntimeEnvironment(getClass)
+    val config = new Config
+    config("admin_text_port") = Props.getInt("admin_text_port") openOr 9989
+    config("admin_http_port") = Props.getInt("admin_http_port") openOr 9990
+    ServiceTracker.startAdmin(config, runtime)
+
     // start Scala Actors used in ESME
     Distributor.touch
     SchedulerActor.touch

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=952273&r1=952272&r2=952273&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
Mon Jun  7 15:31:50 2010
@@ -23,7 +23,8 @@ import net.liftweb._
 import common._
 import actor._
 import org.apache.esme.actor.Distributor.{UserCreatedMessage=>Msg}
-import com.twitter.stats.Stats
+//import com.twitter.stats.Stats
+import com.twitter.ostrich.Stats
 
 object MessagePullActor extends LiftActor {
   

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=952273&r1=952272&r2=952273&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
Mon Jun  7 15:31:50 2010
@@ -26,8 +26,9 @@ import net.liftweb.http.ActorWatcher
 import net.liftweb.util._
 import Helpers._
 import net.liftweb.common._
-import com.twitter.stats.Stats
-import com.twitter.stats.Stats
+//import com.twitter.stats.Stats
+//import com.twitter.stats.Stats
+import com.twitter.ostrich.Stats
 
 
 object SchedulerActor extends LiftActor{

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=952273&r1=952272&r2=952273&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 Mon Jun
 7 15:31:50 2010
@@ -32,7 +32,8 @@ import lib._
 
 import java.util.{TimeZone, Calendar}
 import scala.xml.{Elem}
-import com.twitter.stats.Stats
+//import com.twitter.stats.Stats
+import com.twitter.ostrich.Stats
 
 object UserActor {
   private[actor] case class StartMeUp(user: Long)

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=952273&r1=952272&r2=952273&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 Mon Jun  7
15:31:50 2010
@@ -42,7 +42,8 @@ import org.apache.esme._
 import org.apache.esme.actor._
 import java.net.URL
 import java.util.logging._
-import com.twitter.stats.Stats
+//import com.twitter.stats.Stats
+import com.twitter.ostrich.Stats
 
 object User extends User with KeyedMetaMapper[Long, User] {
   override def afterSave = profileChanged _ :: notifyActors _ :: super.afterSave
@@ -168,7 +169,8 @@ object User extends User with KeyedMetaM
     curUserId.remove()
     curUser.remove()
     S.request.foreach(_.request.session.terminate)
-    Stats getCounter "usersLoggedIn" incr -1
+    //Stats getCounter "usersLoggedIn" incr -1
+    Stats incr ("usersLoggedIn", -1)
   }
 
   private object curUserId extends SessionVar[Box[String]](Empty)



Mime
View raw message