Created
July 17, 2016 16:27
-
-
Save HDBandit/62f16fb758b564415b33a0dd61159b40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pong extends ActorWithJMXSupport with ActorLogging with PongMBean{ | |
import Pong._ | |
var lastReceivedMessage = "UNKNOWN" | |
def receive = { | |
case PongMessage(text) => | |
log.info("In PongActor - received message: {}", text) | |
lastReceivedMessage = text | |
} | |
override def getMXTypeName: String = "InstrumentedPongActor" | |
override def sendMessage(p1: String): Unit = { | |
if (p1.equals("end")) { | |
self ! PoisonPill | |
} else { | |
self ! PongMessage(p1) | |
} | |
} | |
} | |
object Pong { | |
val props = Props[Pong] | |
case class PongMessage(text: String) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment