akka.dispatch
Class Dispatcher

java.lang.Object
  extended by akka.dispatch.MessageDispatcher
      extended by akka.dispatch.Dispatcher
All Implemented Interfaces:
scala.concurrent.ExecutionContext
Direct Known Subclasses:
BalancingDispatcher, PinnedDispatcher

public class Dispatcher
extends MessageDispatcher

The event-based Dispatcher binds a set of Actors to a thread pool backed up by a BlockingQueue.

The preferred way of creating dispatchers is to define configuration of it and use the the lookup method in Dispatchers.


Nested Class Summary
 
Nested classes/interfaces inherited from interface scala.concurrent.ExecutionContext
scala.concurrent.ExecutionContext.Implicits$
 
Constructor Summary
Dispatcher(DispatcherPrerequisites _prerequisites, java.lang.String id, int throughput, scala.concurrent.duration.Duration throughputDeadlineTime, MailboxType mailboxType, ExecutorServiceFactoryProvider executorServiceFactoryProvider, scala.concurrent.duration.FiniteDuration shutdownTimeout)
           
 
Method Summary
 java.lang.ThreadLocal<scala.collection.immutable.List<java.lang.Runnable>> _tasksLocal()
           
 boolean batchable(java.lang.Runnable runnable)
          Override this to define which runnables will be batched.
protected  akka.dispatch.Mailbox createMailbox(akka.actor.Cell actor)
          INTERNAL USE ONLY
protected  void dispatch(akka.actor.ActorCell receiver, Envelope invocation)
          INTERNAL USE ONLY
 void execute(java.lang.Runnable runnable)
           
protected  void executeTask(TaskInvocation invocation)
          INTERNAL USE ONLY
protected  ExecutorServiceDelegate executorService()
           
 java.lang.String id()
          Identifier of this dispatcher, corresponds to the full key of the dispatcher configuration.
 MailboxType mailboxType()
           
protected  boolean registerForExecution(akka.dispatch.Mailbox mbox, boolean hasMessageHint, boolean hasSystemMessageHint)
          Returns if it was registered INTERNAL USE ONLY
protected  void shutdown()
          INTERNAL USE ONLY
 scala.concurrent.duration.FiniteDuration shutdownTimeout()
          When the dispatcher no longer has any actors registered, how long will it wait until it shuts itself down, defaulting to your akka configs "akka.actor.default-dispatcher.shutdown-timeout" or default specified in reference.conf INTERNAL API
protected  void systemDispatch(akka.actor.ActorCell receiver, akka.dispatch.SystemMessage invocation)
          INTERNAL USE ONLY
 int throughput()
          INTERNAL API
 scala.concurrent.duration.Duration throughputDeadlineTime()
          INTERNAL API
 java.lang.String toString()
           
 
Methods inherited from class akka.dispatch.MessageDispatcher
actors, attach, debug, defaultDispatcher, detach, inhabitants, isThroughputDeadlineTimeDefined, prerequisites, printActors, register, reportFailure, RESCHEDULED, resume, SCHEDULED, suspend, unbatchedExecute, unregister, UNSCHEDULED
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface scala.concurrent.ExecutionContext
execute, prepare
 

Constructor Detail

Dispatcher

public Dispatcher(DispatcherPrerequisites _prerequisites,
                  java.lang.String id,
                  int throughput,
                  scala.concurrent.duration.Duration throughputDeadlineTime,
                  MailboxType mailboxType,
                  ExecutorServiceFactoryProvider executorServiceFactoryProvider,
                  scala.concurrent.duration.FiniteDuration shutdownTimeout)
Method Detail

id

public java.lang.String id()
Description copied from class: MessageDispatcher
Identifier of this dispatcher, corresponds to the full key of the dispatcher configuration.

Specified by:
id in class MessageDispatcher

throughput

public int throughput()
Description copied from class: MessageDispatcher
INTERNAL API

Specified by:
throughput in class MessageDispatcher

throughputDeadlineTime

public scala.concurrent.duration.Duration throughputDeadlineTime()
Description copied from class: MessageDispatcher
INTERNAL API

Specified by:
throughputDeadlineTime in class MessageDispatcher

mailboxType

public MailboxType mailboxType()

shutdownTimeout

public scala.concurrent.duration.FiniteDuration shutdownTimeout()
Description copied from class: MessageDispatcher
When the dispatcher no longer has any actors registered, how long will it wait until it shuts itself down, defaulting to your akka configs "akka.actor.default-dispatcher.shutdown-timeout" or default specified in reference.conf

INTERNAL API

Specified by:
shutdownTimeout in class MessageDispatcher

executorService

protected final ExecutorServiceDelegate executorService()

dispatch

protected void dispatch(akka.actor.ActorCell receiver,
                        Envelope invocation)
INTERNAL USE ONLY

Specified by:
dispatch in class MessageDispatcher

systemDispatch

protected void systemDispatch(akka.actor.ActorCell receiver,
                              akka.dispatch.SystemMessage invocation)
INTERNAL USE ONLY

Specified by:
systemDispatch in class MessageDispatcher

executeTask

protected void executeTask(TaskInvocation invocation)
INTERNAL USE ONLY

Specified by:
executeTask in class MessageDispatcher

createMailbox

protected akka.dispatch.Mailbox createMailbox(akka.actor.Cell actor)
INTERNAL USE ONLY

Specified by:
createMailbox in class MessageDispatcher

shutdown

protected void shutdown()
INTERNAL USE ONLY

Specified by:
shutdown in class MessageDispatcher

registerForExecution

protected boolean registerForExecution(akka.dispatch.Mailbox mbox,
                                       boolean hasMessageHint,
                                       boolean hasSystemMessageHint)
Returns if it was registered

INTERNAL USE ONLY

Specified by:
registerForExecution in class MessageDispatcher

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

_tasksLocal

public java.lang.ThreadLocal<scala.collection.immutable.List<java.lang.Runnable>> _tasksLocal()

execute

public void execute(java.lang.Runnable runnable)
Specified by:
execute in interface java.util.concurrent.Executor

batchable

public boolean batchable(java.lang.Runnable runnable)
Override this to define which runnables will be batched.