pl.bristleback.server.bristle.exceptions.handlers
Class ExceptionHandlersContainer

java.lang.Object
  extended by pl.bristleback.server.bristle.exceptions.handlers.ExceptionHandlersContainer

public class ExceptionHandlersContainer
extends java.lang.Object

This class is a simple container for exception handlers. Every occurring exception which can be handled and collected here is caused by user. Actual list of exceptions possible to handle can be found in ActionExceptionType enum.

Created on: 2010-10-23 23:56:13

Author:
Wojciech Niemiec

Constructor Summary
ExceptionHandlersContainer()
          Creates a empty exception handlers container.
 
Method Summary
 void addHandler(ActionExceptionType actionExceptionType, ExceptionHandler handler)
          Adds a handler to container.
 void invokeHandler(ActionExceptionType actionExceptionType, org.jwebsocket.api.WebSocketConnector connector, org.jwebsocket.token.Token token)
          Invokes (if exists) handler for given exception type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionHandlersContainer

public ExceptionHandlersContainer()
Creates a empty exception handlers container.

Method Detail

invokeHandler

public void invokeHandler(ActionExceptionType actionExceptionType,
                          org.jwebsocket.api.WebSocketConnector connector,
                          org.jwebsocket.token.Token token)
Invokes (if exists) handler for given exception type. Information about connector and token is passed to handler.

Parameters:
actionExceptionType - exception type to handle.
connector - websocket connector.
token - content of message sent by connector.

addHandler

public void addHandler(ActionExceptionType actionExceptionType,
                       ExceptionHandler handler)
Adds a handler to container. Note that in current version of Bristle plugin, there is no way to have multiple handlers for the same exception type.

Parameters:
actionExceptionType - type of exception to handle.
handler - exception handler implementation.


Copyright © 2011. All Rights Reserved.