merged with upstream

This commit is contained in:
Jonas Bonér 2010-03-30 23:16:18 +02:00
commit 7cf13c7715
2 changed files with 6 additions and 25 deletions

View file

@ -42,7 +42,7 @@ trait Transactor extends Actor {
* *
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a> * @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
bstract class RemoteActor(hostname: String, port: Int) extends Actor { abstract class RemoteActor(hostname: String, port: Int) extends Actor {
makeRemote(hostname, port) makeRemote(hostname, port)
} }
@ -161,7 +161,7 @@ object Actor extends Logging {
case object Spawn case object Spawn
new Actor() { new Actor() {
start start
send(Spawn) this ! Spawn
def receive = { def receive = {
case Spawn => body; stop case Spawn => body; stop
} }
@ -466,7 +466,7 @@ trait Actor extends TransactionManagement with Logging {
_remoteAddress.foreach(address => RemoteClient.unregister(address.getHostName, address.getPort, uuid)) _remoteAddress.foreach(address => RemoteClient.unregister(address.getHostName, address.getPort, uuid))
} }
} }
$
def isRunning = _isRunning def isRunning = _isRunning
/** /**
@ -476,27 +476,12 @@ trait Actor extends TransactionManagement with Logging {
* If invoked from within an actor then the actor reference is implicitly passed on as the implicit 'sender' argument. * If invoked from within an actor then the actor reference is implicitly passed on as the implicit 'sender' argument.
* <p/> * <p/>
* *
* This actor 'sender' reference is then available in the receiving actor in the 'sender' member variable. * This actor 'sender' reference is then available in the receiving actor in the 'sender' member variable,
* if invoked from within an Actor. If not then no sender is available.
* <pre> * <pre>
* actor ! message * actor ! message
* </pre> * </pre>
* <p/> * <p/>
*
* If invoked from within a *non* Actor instance then either add this import to resolve the implicit argument:
* <pre>
* import Actor.Sender.Self
* actor ! message
* </pre>
*
* Or pass in the implicit argument explicitly:
* <pre>
* actor.!(message)(Some(this))
* </pre>
*
* Or use the 'send(..)' method;
* <pre>
* actor.send(message)
* </pre>
*/ */
def !(message: Any)(implicit sender: Option[Actor] = None) = { def !(message: Any)(implicit sender: Option[Actor] = None) = {
if (_isKilled) throw new ActorKilledException("Actor [" + toString + "] has been killed, can't respond to messages") if (_isKilled) throw new ActorKilledException("Actor [" + toString + "] has been killed, can't respond to messages")
@ -504,11 +489,6 @@ trait Actor extends TransactionManagement with Logging {
else throw new IllegalStateException("Actor has not been started, you need to invoke 'actor.start' before using it") else throw new IllegalStateException("Actor has not been started, you need to invoke 'actor.start' before using it")
} }
/**
* Same as the '!' method but does not take an implicit sender as second parameter.
*/
def send(message: Any) = this.!(message)(None)
/** /**
* Sends a message asynchronously and waits on a future for a reply message. * Sends a message asynchronously and waits on a future for a reply message.
* <p/> * <p/>

View file

@ -444,6 +444,7 @@ class AkkaParent(info: ProjectInfo) extends AkkaDefaults(info) {
class AkkaSampleSecurityProject(info: ProjectInfo) extends AkkaDefaults(info) { class AkkaSampleSecurityProject(info: ProjectInfo) extends AkkaDefaults(info) {
val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1.1" % "compile" val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1.1" % "compile"
val jsr250 = "javax.annotation" % "jsr250-api" % "1.0" val jsr250 = "javax.annotation" % "jsr250-api" % "1.0"
val commons_codec = "commons-codec" % "commons-codec" % "1.3" % "compile"
lazy val dist = deployTask(info, deployPath) dependsOn(`package`, packageDocs, packageSrc) describedAs("Deploying") lazy val dist = deployTask(info, deployPath) dependsOn(`package`, packageDocs, packageSrc) describedAs("Deploying")
} }