akka.actor
Class TypedActor

java.lang.Object
  extended by akka.actor.TypedActor
All Implemented Interfaces:
ExtensionId<TypedActorExtension>, ExtensionIdProvider

public class TypedActor
extends java.lang.Object
implements ExtensionId<TypedActorExtension>, ExtensionIdProvider

This represents the TypedActor Akka Extension, access to the functionality is done through a given ActorSystem.


Nested Class Summary
static class TypedActor.MethodCall
          This class represents a Method call, and has a reference to the Method to be called and the parameters to supply It's sent to the ActorRef backing the TypedActor and can be serialized and deserialized
static class TypedActor.MethodCall$
           
static interface TypedActor.PostRestart
           
static interface TypedActor.PostStop
          Mix this into your TypedActor to be able to hook into its lifecycle
static interface TypedActor.PreRestart
          Mix this into your TypedActor to be able to hook into its lifecycle
static interface TypedActor.PreStart
          Mix this into your TypedActor to be able to hook into its lifecycle
static interface TypedActor.Receiver
          Mix this into your TypedActor to be able to intercept Terminated messages
static interface TypedActor.Supervisor
          Mix this into your TypedActor to be able to define supervisor strategy
 
Constructor Summary
TypedActor()
           
 
Method Summary
static TypedActorFactory apply(ActorContext context)
          Returns a contextual TypedActorFactory of this extension, this means that any TypedActors created by this TypedActorExtension will be children to the specified context, this allows for creating hierarchies of TypedActors.
static ActorContext context()
          Returns the ActorContext (for a TypedActor) when inside a method call in a TypedActor.
static TypedActorExtension createExtension(ExtendedActorSystem system)
           
static MessageDispatcher dispatcher()
          Returns the default dispatcher (for a TypedActor) when inside a method call in a TypedActor.
static TypedActorFactory get(ActorContext context)
          Returns a contextual TypedActorFactory of this extension, this means that any TypedActors created by this TypedActorExtension will be children to the specified context, this allows for creating hierarchies of TypedActors.
static TypedActorExtension get(ActorSystem system)
           
static TypedActor$ lookup()
           
static
<T> T
self()
          Returns the reference to the proxy when called inside a method call in a TypedActor Example:

class FooImpl extends Foo { def doFoo { val myself = TypedActor.self[Foo] } } Useful when you want to send a reference to this TypedActor to someone else.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface akka.actor.ExtensionId
apply, createExtension, get
 
Methods inherited from interface akka.actor.ExtensionIdProvider
lookup
 

Constructor Detail

TypedActor

public TypedActor()
Method Detail

get

public static TypedActorExtension get(ActorSystem system)

lookup

public static TypedActor$ lookup()

createExtension

public static TypedActorExtension createExtension(ExtendedActorSystem system)

apply

public static TypedActorFactory apply(ActorContext context)
Returns a contextual TypedActorFactory of this extension, this means that any TypedActors created by this TypedActorExtension will be children to the specified context, this allows for creating hierarchies of TypedActors. Do _not_ let this instance escape the TypedActor since that will not be thread-safe.


get

public static TypedActorFactory get(ActorContext context)
Returns a contextual TypedActorFactory of this extension, this means that any TypedActors created by this TypedActorExtension will be children to the specified context, this allows for creating hierarchies of TypedActors. Do _not_ let this instance escape the TypedActor since that will not be thread-safe.

Java API


self

public static <T> T self()
Returns the reference to the proxy when called inside a method call in a TypedActor

Example:

class FooImpl extends Foo { def doFoo { val myself = TypedActor.self[Foo] } }

Useful when you want to send a reference to this TypedActor to someone else.

NEVER EXPOSE "this" to someone else, always use "self[TypeOfInterface(s)]"

Throws:
java.lang.IllegalStateException - if called outside of the scope of a method on this TypedActor
java.lang.ClassCastException - if the supplied type T isn't the type of the proxy associated with this TypedActor

context

public static ActorContext context()
Returns the ActorContext (for a TypedActor) when inside a method call in a TypedActor.


dispatcher

public static MessageDispatcher dispatcher()
Returns the default dispatcher (for a TypedActor) when inside a method call in a TypedActor.