akka.actor
Class TypedActor.TypedActor<R,T extends R>

java.lang.Object
  extended by akka.actor.TypedActor.TypedActor<R,T>
All Implemented Interfaces:
Actor
Enclosing class:
TypedActor

public static class TypedActor.TypedActor<R,T extends R>
extends java.lang.Object
implements Actor

INTERNAL API

Implementation of TypedActor as an Actor


Nested Class Summary
 
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$
 
Constructor Summary
TypedActor.TypedActor(java.util.concurrent.atomic.AtomicReference<R> proxyVar, scala.Function0<T> createInstance, scala.collection.immutable.Seq<java.lang.Class<?>> interfaces)
           
 
Method Summary
 void postRestart(java.lang.Throwable reason)
          User overridable callback: By default it calls preStart().
 void postStop()
          User overridable callback.
 void preRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
          User overridable callback: '''By default it disposes of all children and then calls postStop().'''
 void preStart()
          User overridable callback.
 java.util.concurrent.atomic.AtomicReference<R> proxyVar()
           
 scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
          This defines the initial actor behavior, it must return a partial function with the actor logic.
 SupervisorStrategy supervisorStrategy()
          User overridable definition the strategy to use for supervising child actors.
protected
<T> T
withContext(scala.Function0<T> unitOfWork)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface akka.actor.Actor
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, self, sender, unhandled
 

Constructor Detail

TypedActor.TypedActor

public TypedActor.TypedActor(java.util.concurrent.atomic.AtomicReference<R> proxyVar,
                             scala.Function0<T> createInstance,
                             scala.collection.immutable.Seq<java.lang.Class<?>> interfaces)
Method Detail

proxyVar

public java.util.concurrent.atomic.AtomicReference<R> proxyVar()

supervisorStrategy

public SupervisorStrategy supervisorStrategy()
Description copied from interface: Actor
User overridable definition the strategy to use for supervising child actors.

Specified by:
supervisorStrategy in interface Actor
Returns:
(undocumented)

preStart

public void preStart()
Description copied from interface: Actor
User overridable callback.

Is called when an Actor is started. Actors are automatically started asynchronously when created. Empty default implementation.

Specified by:
preStart in interface Actor

postStop

public void postStop()
Description copied from interface: Actor
User overridable callback.

Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.

Specified by:
postStop in interface Actor

preRestart

public void preRestart(java.lang.Throwable reason,
                       scala.Option<java.lang.Object> message)
Description copied from interface: Actor
User overridable callback: '''By default it disposes of all children and then calls postStop().'''

Specified by:
preRestart in interface Actor
Parameters:
reason - the Throwable that caused the restart to happen
message - optionally the current message the actor processed when failing, if applicable

Is called on a crashed Actor right BEFORE it is restarted to allow clean up of resources before Actor is terminated.

postRestart

public void postRestart(java.lang.Throwable reason)
Description copied from interface: Actor
User overridable callback: By default it calls preStart().

Specified by:
postRestart in interface Actor
Parameters:
reason - the Throwable that caused the restart to happen

Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.

withContext

protected <T> T withContext(scala.Function0<T> unitOfWork)

receive

public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Description copied from interface: Actor
This defines the initial actor behavior, it must return a partial function with the actor logic.

Specified by:
receive in interface Actor
Returns:
(undocumented)