akka/akka — pull request #492 by havocp (2012-05-28 19:24:53+00:00)
Title: add Actor.aroundReceive to support mixin traits

aroundReceive allows a trait or abstract base class
to modify each behavior pushed onto the behavior
stack, including the initial receive and any
behaviors that we become later.

A common use of aroundReceive would be to add
another partial function in front of or
after the normal behavior, with `orElse`.

Implementations of aroundReceive are expected to
chain up to supertype implementations, so if
multiple mixed-in traits or classes call
aroundReceive, they will all co-exist.

This leaves the receive method available for
concrete classes, keeping mixin traits completely
orthogonal (the class you mixin to doesn't need
any changes).