akka.actor

Actor

object Actor extends ListenerManagement

Actor factory module with factory methods for creating various kinds of Actors.

Linear Supertypes
ListenerManagement, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Actor
  2. ListenerManagement
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Type Members

  1. type Receive = PartialFunction[Any, Unit]

    A Receive is a convenience type that defines actor message behavior currently modeled as a PartialFunction[Any, Unit].

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def actorOf (creator: Creator[Actor]): ActorRef

    Creates an ActorRef out of the Actor.

    Creates an ActorRef out of the Actor. Allows you to pass in a factory (Creator<Actor>) that creates the Actor. Please note that this function can be invoked multiple times if for example the Actor is supervised and needs to be restarted.

    This function should NOT be used for remote actors. JAVA API

  7. def actorOf (factory: ⇒ Actor): ActorRef

    Creates an ActorRef out of the Actor.

    Creates an ActorRef out of the Actor. Allows you to pass in a factory function that creates the Actor. Please note that this function can be invoked multiple times if for example the Actor is supervised and needs to be restarted.

    This function should NOT be used for remote actors.

      import Actor._
      val actor = actorOf(new MyActor)
      actor.start()
      actor ! message
      actor.stop()
    
    You can create and start the actor in one statement like this:
      val actor = actorOf(new MyActor).start()
    

  8. def actorOf (clazz: Class[_ <: akka.actor.Actor]): ActorRef

    Creates an ActorRef out of the Actor of the specified Class.

    Creates an ActorRef out of the Actor of the specified Class.

      import Actor._
      val actor = actorOf(classOf[MyActor])
      actor.start()
      actor ! message
      actor.stop()
    
    You can create and start the actor in one statement like this:
      val actor = actorOf(classOf[MyActor]).start()
    

  9. def actorOf [T <: Actor] (implicit arg0: Manifest[T]): ActorRef

    Creates an ActorRef out of the Actor with type T.

    Creates an ActorRef out of the Actor with type T.

      import Actor._
      val actor = actorOf[MyActor]
      actor.start()
      actor ! message
      actor.stop()
    
    You can create and start the actor in one statement like this:
      val actor = actorOf[MyActor].start()
    

  10. def addListener (listener: ActorRef): Unit

    Adds the listener this this registry's listener list.

    Adds the listener this this registry's listener list. The listener is started by this method if manageLifeCycleOfListeners yields true.

    Definition Classes
    ListenerManagement
  11. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  12. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  14. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def foreachListener (f: (ActorRef) ⇒ Unit): Unit

    Execute f with each listener as argument.

    Execute f with each listener as argument. ActorInitializationException is not handled.

    Attributes
    protected[akka]
    Definition Classes
    ListenerManagement
  17. implicit def futureToAnyOptionAsTypedOption (anyFuture: akka.dispatch.Future[_]): AnyOptionAsTypedOption

    Implicitly converts the given Future[_] to a AnyOptionAsTypedOption which offers the method as[T] to convert an Option[Any] to an Option[T].

    Implicitly converts the given Future[_] to a AnyOptionAsTypedOption which offers the method as[T] to convert an Option[Any] to an Option[T]. This means that the following code is equivalent: (actor !! "foo").as[Int] (Deprecated) and (actor !!! "foo").as[Int] (Recommended)

    Attributes
    implicit
  18. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef
  19. def hasListener (listener: ActorRef): Boolean

    Checks if a specific listener is registered.

    Checks if a specific listener is registered. ActorInitializationException leads to removal of listener if that one isShutdown.

    Definition Classes
    ListenerManagement
  20. def hasListeners : Boolean

    Definition Classes
    ListenerManagement
  21. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  22. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  23. def manageLifeCycleOfListeners : Boolean

    Specifies whether listeners should be started when added and stopped when removed or not

    Specifies whether listeners should be started when added and stopped when removed or not

    Attributes
    protected
    Definition Classes
    ListenerManagement
  24. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  25. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  26. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  27. def notifyListeners (message: ⇒ Any): Unit

    Attributes
    protected[akka]
    Definition Classes
    ListenerManagement
  28. val registry : ActorRegistry

  29. lazy val remote : RemoteSupport

  30. def removeListener (listener: ActorRef): Unit

    Removes the listener this this registry's listener list.

    Removes the listener this this registry's listener list. The listener is stopped by this method if manageLifeCycleOfListeners yields true.

    Definition Classes
    ListenerManagement
  31. def spawn (body: ⇒ Unit)(implicit dispatcher: MessageDispatcher = Dispatchers.defaultGlobalDispatcher): Unit

    Use to spawn out a block of code in an event-driven actor.

    Use to spawn out a block of code in an event-driven actor. Will shut actor down when the block has been executed.

    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
    }
    

  32. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  33. implicit def toAnyOptionAsTypedOption (anyOption: Option[Any]): AnyOptionAsTypedOption

    Implicitly converts the given Option[Any] to a AnyOptionAsTypedOption which offers the method as[T] to convert an Option[Any] to an Option[T].

    Implicitly converts the given Option[Any] to a AnyOptionAsTypedOption which offers the method as[T] to convert an Option[Any] to an Option[T].

    Attributes
    implicit
  34. def toString (): String

    Definition Classes
    AnyRef → Any
  35. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  36. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  37. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from ListenerManagement

Inherited from AnyRef

Inherited from Any