Added EventHandler.shutdown()'
This commit is contained in:
parent
e3a7a2cf66
commit
06c134ca91
1 changed files with 13 additions and 0 deletions
|
|
@ -44,6 +44,11 @@ import akka.AkkaException
|
|||
* EventHandler.error(exception, this, message)
|
||||
* </pre>
|
||||
*
|
||||
* Shut down the EventHandler:
|
||||
* <pre>
|
||||
* EventHandler.shutdown()
|
||||
* </pre>
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
object EventHandler extends ListenerManagement {
|
||||
|
|
@ -94,6 +99,14 @@ object EventHandler extends ListenerManagement {
|
|||
"Configuration option 'akka.event-handler-level' is invalid [" + unknown + "]")
|
||||
}
|
||||
|
||||
/**
|
||||
* Shuts down all event handler listeners including the event handle dispatcher.
|
||||
*/
|
||||
def shutdown() = {
|
||||
foreachListener(_.stop)
|
||||
EventHandlerDispatcher.shutdown
|
||||
}
|
||||
|
||||
def notify(event: Any) {
|
||||
if (event.isInstanceOf[Event]) {
|
||||
if (level >= event.asInstanceOf[Event].level) notifyListeners(event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue