Skip to content

Commit

Permalink
merged with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Bonér committed Mar 30, 2010
2 parents 84ee350 + 933a7c8 commit 7cf13c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
30 changes: 5 additions & 25 deletions akka-core/src/main/scala/actor/Actor.scala
Expand Up @@ -42,7 +42,7 @@ trait Transactor extends Actor {
*
* @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)
}

Expand Down Expand Up @@ -161,7 +161,7 @@ object Actor extends Logging {
case object Spawn
new Actor() {
start
send(Spawn)
this ! Spawn
def receive = {
case Spawn => body; stop
}
Expand Down Expand Up @@ -466,7 +466,7 @@ trait Actor extends TransactionManagement with Logging {
_remoteAddress.foreach(address => RemoteClient.unregister(address.getHostName, address.getPort, uuid))
}
}

$
def isRunning = _isRunning

/**
Expand All @@ -476,39 +476,19 @@ 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.
* <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>
* actor ! message
* </pre>
* <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) = {
if (_isKilled) throw new ActorKilledException("Actor [" + toString + "] has been killed, can't respond to messages")
if (_isRunning) postMessageToMailbox(message, sender)
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.
* <p/>
Expand Down
1 change: 1 addition & 0 deletions project/build/AkkaProject.scala
Expand Up @@ -444,6 +444,7 @@ class AkkaParent(info: ProjectInfo) extends AkkaDefaults(info) {
class AkkaSampleSecurityProject(info: ProjectInfo) extends AkkaDefaults(info) {
val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1.1" % "compile"
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")
}

Expand Down

0 comments on commit 7cf13c7

Please sign in to comment.