#1958 - adding docs for lifecycle hook-parameters

This commit is contained in:
Viktor Klang 2012-04-03 15:18:07 +02:00
parent d8b0fcf629
commit faaeed45d0
2 changed files with 9 additions and 4 deletions

View file

@ -246,6 +246,8 @@ trait Actor {
/**
* User overridable callback: '''By default it disposes of all children and then calls `postStop()`.'''
* @param reason the Throwable that caused the restart to happen
* @param message optionally the current message the actor processed when failing, if applicable
* <p/>
* Is called on a crashed Actor right BEFORE it is restarted to allow clean
* up of resources before Actor is terminated.
@ -257,6 +259,7 @@ trait Actor {
/**
* User overridable callback: By default it calls `preStart()`.
* @param reason the Throwable that caused the restart to happen
* <p/>
* Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.
*/

View file

@ -340,21 +340,23 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
*/
trait PreRestart {
/**
* User overridable callback.
* User overridable callback: '''By default it disposes of all children and then calls `postStop()`.'''
* @param reason the Throwable that caused the restart to happen
* @param message optionally the current message the actor processed when failing, if applicable
* <p/>
* Is called on a crashed Actor right BEFORE it is restarted to allow clean
* up of resources before Actor is terminated.
* By default it calls postStop()
* By default it terminates all children and calls postStop()
*/
def preRestart(reason: Throwable, message: Option[Any]): Unit
}
trait PostRestart {
/**
* User overridable callback.
* User overridable callback: By default it calls `preStart()`.
* @param reason the Throwable that caused the restart to happen
* <p/>
* Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.
* By default it calls preStart()
*/
def postRestart(reason: Throwable): Unit
}