Enhanced the RemoteServer/RemoteClient listener API

This commit is contained in:
Jonas Bonér 2010-08-21 18:05:06 +02:00
parent 70d61b118a
commit 2d20294d0f
5 changed files with 59 additions and 59 deletions

View file

@ -12,4 +12,4 @@ Actors also provide the abstraction for transparent distribution and the basis f
Akka is Open Source and available under the Apache 2 License. Akka is Open Source and available under the Apache 2 License.
Learn more at "http://akkasource.org":http://akkasource.org Learn more at "http://akkasource.org":http://akkasource.org.

View file

@ -52,7 +52,9 @@ case class RemoteClientDisconnected(
@BeanProperty val client: RemoteClient) extends RemoteClientLifeCycleEvent @BeanProperty val client: RemoteClient) extends RemoteClientLifeCycleEvent
case class RemoteClientConnected( case class RemoteClientConnected(
@BeanProperty val client: RemoteClient) extends RemoteClientLifeCycleEvent @BeanProperty val client: RemoteClient) extends RemoteClientLifeCycleEvent
case class RemoteClientStopped( case class RemoteClientStarted(
@BeanProperty val client: RemoteClient) extends RemoteClientLifeCycleEvent
case class RemoteClientShutdown(
@BeanProperty val client: RemoteClient) extends RemoteClientLifeCycleEvent @BeanProperty val client: RemoteClient) extends RemoteClientLifeCycleEvent
/** /**
@ -213,6 +215,7 @@ class RemoteClient private[akka] (val hostname: String, val port: Int, val loade
foreachListener(l => l ! RemoteClientError(connection.getCause, this)) foreachListener(l => l ! RemoteClientError(connection.getCause, this))
log.error(connection.getCause, "Remote client connection to [%s:%s] has failed", hostname, port) log.error(connection.getCause, "Remote client connection to [%s:%s] has failed", hostname, port)
} }
foreachListener(l => l ! RemoteClientStarted(this))
isRunning = true isRunning = true
} }
} }
@ -221,11 +224,11 @@ class RemoteClient private[akka] (val hostname: String, val port: Int, val loade
log.info("Shutting down %s", name) log.info("Shutting down %s", name)
if (isRunning) { if (isRunning) {
isRunning = false isRunning = false
foreachListener(l => l ! RemoteClientShutdown(this))
timer.stop timer.stop
openChannels.close.awaitUninterruptibly openChannels.close.awaitUninterruptibly
bootstrap.releaseExternalResources bootstrap.releaseExternalResources
log.info("%s has been shut down", name) log.info("%s has been shut down", name)
foreachListener(l => l ! RemoteClientStopped(this))
} }
} }

View file

@ -45,33 +45,30 @@ class AkkaLoader extends Logging {
} }
private def printBanner = { private def printBanner = {
log.info( log.info("==================================================")
""" log.info(" t")
t log.info(" t t t")
t t t log.info(" t t tt t")
t t tt t log.info(" tt t t tt t")
tt t t tt t log.info(" t ttttttt t ttt t")
t ttttttt t ttt t log.info(" t tt ttt t ttt t")
t tt ttt t ttt t log.info(" t t ttt t ttt t t")
t t ttt t ttt t t log.info(" tt t ttt ttt ttt t")
tt t ttt ttt ttt t log.info(" t t ttt ttt t tt t")
t t ttt ttt t tt t log.info(" t ttt ttt t t")
t ttt ttt t t log.info(" tt ttt ttt t")
tt ttt ttt t log.info(" ttt ttt")
ttt ttt log.info(" tttttttt ttt ttt ttt ttt tttttttt")
tttttttt ttt ttt ttt ttt tttttttt log.info(" ttt tt ttt ttt ttt ttt ttt ttt")
ttt tt ttt ttt ttt ttt ttt ttt log.info(" ttt ttt ttt ttt ttt ttt ttt ttt")
ttt ttt ttt ttt ttt ttt ttt ttt log.info(" ttt ttt ttt ttt ttt tt ttt ttt")
ttt ttt ttt ttt ttt tt ttt ttt log.info(" tttt ttttttttt tttttttt tttt")
tttt ttttttttt tttttttt tttt log.info(" ttttttttt ttt ttt ttt ttt ttttttttt")
ttttttttt ttt ttt ttt ttt ttttttttt log.info(" ttt ttt ttt ttt ttt ttt ttt ttt")
ttt ttt ttt ttt ttt ttt ttt ttt log.info(" ttt ttt ttt ttt ttt ttt ttt ttt")
ttt ttt ttt ttt ttt ttt ttt ttt log.info(" ttt tt ttt ttt ttt ttt ttt ttt")
ttt tt ttt ttt ttt ttt ttt ttt log.info(" tttttttt ttt ttt ttt ttt tttttttt")
tttttttt ttt ttt ttt ttt tttttttt log.info("==================================================")
==================================================
""")
log.info(" Running version %s", Config.VERSION) log.info(" Running version %s", Config.VERSION)
log.info("==================================================") log.info("==================================================")
} }

View file

@ -84,9 +84,9 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val ATMO_VERSION = "0.6.1" lazy val ATMO_VERSION = "0.6.1"
lazy val CAMEL_VERSION = "2.4.0" lazy val CAMEL_VERSION = "2.4.0"
lazy val CASSANDRA_VERSION = "0.6.1" lazy val CASSANDRA_VERSION = "0.6.1"
lazy val DispatchVersion = "0.7.4" lazy val DISPATCH_VERSION = "0.7.4"
lazy val HAWTDISPATCH_VERSION = "1.0" lazy val HAWT_DISPATCH_VERSION = "1.0"
lazy val JacksonVersion = "1.2.1" lazy val JACKSON_VERSION = "1.2.1"
lazy val JERSEY_VERSION = "1.2" lazy val JERSEY_VERSION = "1.2"
lazy val LIFT_VERSION = "2.1-M1" lazy val LIFT_VERSION = "2.1-M1"
lazy val MULTIVERSE_VERSION = "0.6" lazy val MULTIVERSE_VERSION = "0.6"
@ -94,7 +94,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val LOGBACK_VERSION = "0.9.24" lazy val LOGBACK_VERSION = "0.9.24"
lazy val SLF4J_VERSION = "1.6.0" lazy val SLF4J_VERSION = "1.6.0"
lazy val SPRING_VERSION = "3.0.3.RELEASE" lazy val SPRING_VERSION = "3.0.3.RELEASE"
lazy val WerkzVersion = "2.2.1" lazy val ASPECTWERKZ_VERSION = "2.2.1"
// ------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------
// Dependencies // Dependencies
@ -131,8 +131,8 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val configgy = "net.lag" % "configgy" % "2.8.0-1.5.5" % "compile" lazy val configgy = "net.lag" % "configgy" % "2.8.0-1.5.5" % "compile"
lazy val dispatch_http = "net.databinder" % "dispatch-http_2.8.0" % DispatchVersion % "compile" lazy val dispatch_http = "net.databinder" % "dispatch-http_2.8.0" % DISPATCH_VERSION % "compile"
lazy val dispatch_json = "net.databinder" % "dispatch-json_2.8.0" % DispatchVersion % "compile" lazy val dispatch_json = "net.databinder" % "dispatch-json_2.8.0" % DISPATCH_VERSION % "compile"
lazy val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile" lazy val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile"
@ -140,11 +140,11 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val h2_lzf = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile" lazy val h2_lzf = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile"
lazy val hawtdispatch = "org.fusesource.hawtdispatch" % "hawtdispatch-scala" % HAWTDISPATCH_VERSION % "compile" lazy val hawtdispatch = "org.fusesource.hawtdispatch" % "hawtdispatch-scala" % HAWT_DISPATCH_VERSION % "compile"
lazy val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % JacksonVersion % "compile" lazy val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % JACKSON_VERSION % "compile"
lazy val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % JacksonVersion % "compile" lazy val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % JACKSON_VERSION % "compile"
lazy val jackson_core_asl = "org.codehaus.jackson" % "jackson-core-asl" % JacksonVersion % "compile" lazy val jackson_core_asl = "org.codehaus.jackson" % "jackson-core-asl" % JACKSON_VERSION % "compile"
lazy val jersey = "com.sun.jersey" % "jersey-core" % JERSEY_VERSION % "compile" lazy val jersey = "com.sun.jersey" % "jersey-core" % JERSEY_VERSION % "compile"
lazy val jersey_json = "com.sun.jersey" % "jersey-json" % JERSEY_VERSION % "compile" lazy val jersey_json = "com.sun.jersey" % "jersey-json" % JERSEY_VERSION % "compile"
@ -196,8 +196,8 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val thrift = "com.facebook" % "thrift" % "r917130" % "compile" lazy val thrift = "com.facebook" % "thrift" % "r917130" % "compile"
lazy val werkz = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % WerkzVersion % "compile" lazy val werkz = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % ASPECTWERKZ_VERSION % "compile"
lazy val werkz_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % WerkzVersion % "compile" lazy val werkz_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % ASPECTWERKZ_VERSION % "compile"
// Test // Test