From d037bfa37b28f3dd4ac3473c94b2d2ccf3d0bb88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Mon, 29 Mar 2010 11:25:23 +0200 Subject: [PATCH] improved scaladoc --- akka-core/src/main/scala/actor/Actor.scala | 24 +++++++++---------- .../src/main/scala/stm/Transaction.scala | 3 --- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/akka-core/src/main/scala/actor/Actor.scala b/akka-core/src/main/scala/actor/Actor.scala index e8ef14d7fc..56f60161c9 100644 --- a/akka-core/src/main/scala/actor/Actor.scala +++ b/akka-core/src/main/scala/actor/Actor.scala @@ -108,7 +108,7 @@ object Actor extends Logging { *
    * import Actor._
    *
-   * val a = transactor  {
+   * val a = transactor {
    *   case msg => ... // handle message
    * }
    * 
@@ -123,7 +123,7 @@ object Actor extends Logging { * The actor is started when created. * Example: *
-   * val a = Actor.init  {
+   * val a = Actor.init {
    *   ... // init stuff
    * } receive  {
    *   case msg => ... // handle message
@@ -143,22 +143,21 @@ object Actor extends Logging {
   }
 
   /**
-   * Use to create an anonymous event-driven actor with a body but no message loop block.
+   * Use to spawn out a block of code in an event-driven actor. Will shut actor down when 
+   * the block has been executed.
    * 

- * This actor can not respond to any messages but can be used as a simple way to - * spawn a lightweight thread to process some task. - *

- * The actor is started when created. + * NOTE: If used from within an Actor then has to be qualified with 'Actor.spawn' since + * there is a method 'spawn[ActorType]' in the Actor trait already. * Example: *

    * import Actor._
    *
-   * spawn  {
+   * spawn {
    *   ... // do stuff
    * }
    * 
*/ - def spawn(body: => Unit): Actor = { + def spawn(body: => Unit): Unit = { case object Spawn new Actor() { start @@ -194,7 +193,7 @@ object Actor extends Logging { *
    * import Actor._
    *
-   * val a = actor("localhost", 9999)  {
+   * val a = actor("localhost", 9999) {
    *   case msg => ... // handle message
    * }
    * 
@@ -368,7 +367,7 @@ trait Actor extends TransactionManagement with Logging { *

* Example code: *

-   *   def receive =  {
+   *   def receive = {
    *     case Ping =>
    *       println("got a ping")
    *       reply("pong")
@@ -599,7 +598,8 @@ trait Actor extends TransactionManagement with Logging {
               "\n\t\t2. Send a message from an instance that is *not* an actor" +
               "\n\t\t3. Send a message to an Active Object annotated with the '@oneway' annotation? " +
               "\n\tIf so, switch to '!!' (or remove '@oneway') which passes on an implicit future" +
-              "\n\tthat will be bound by the argument passed to 'reply'. Alternatively, you can use setReplyToAddress to make sure the actor can be contacted over the network.")
+              "\n\tthat will be bound by the argument passed to 'reply'."
+              "\n\tAlternatively, you can use setReplyToAddress to make sure the actor can be contacted over the network.")
           case Some(future) =>
             future.completeWithResult(message)
         }
diff --git a/akka-core/src/main/scala/stm/Transaction.scala b/akka-core/src/main/scala/stm/Transaction.scala
index 4bcb8f5a26..c86abe662b 100644
--- a/akka-core/src/main/scala/stm/Transaction.scala
+++ b/akka-core/src/main/scala/stm/Transaction.scala
@@ -122,9 +122,6 @@ object Transaction extends TransactionManagement with Logging {
    * See ScalaDoc on Transaction class.
    */
   def atomic[T](body: => T)(implicit transactionFamilyName: String): T = {
-    // FIXME use Transaction Builder and set the transactionFamilyName
-    //    defaultTxBuilder.setFamilyName(transactionFamilyName)
-    //    new TransactionTemplate[T](defaultTxBuilder.build) {
     var isTopLevelTransaction = true
     new TransactionTemplate[T]() {
       def execute(mtx: MultiverseTransaction): T = {