true
@author Stuart Douglas
$Id: ExceptionHandler.java 180 2010-12-12 18:47:56Z georgosn $
@author $LastChangedBy: georgosn $ @version $LastChangedRevision: 182 $As responses can be received either synchronously or asynchronously, control flow can be somewhat obscure and the code to catch exceptions can be error prone. Use of an exception handler makes life simpler.
To assign an exception handler, call the setExceptionHandler method in the constructor of an actor.
If an exception occurs when processing a request, and no exception handler has been assigned, the exception is passed to the exception handler of the actor which sent the request, recursively.
public class Doer extends JLPCActor { public Doer(Mailbox mailbox) { super(mailbox); } protected void processRequest(final Object request, final RP rp) throws Exception { setExceptionHandler(new ExceptionHandler() { public void process(Throwable exception) throws Exception { System.out.println("Exception caught by Doer"); rp.process(null); } }); if (request instanceof T1) { throw new Exception("Exception thrown in request processing"); } else { rp.process(request); } } }
Interface describing a "strategy pattern" implementation for handling exceptions thrown by an application event callback that is managed by Shale. A suitable instance may be acquired by calling ExceptionHandlerFactory.getInstance().getExceptionHandler()
.
An ExceptionHandler is configured in the Struts configuration file to handle a specific type of exception thrown by an Action.execute
method.
ThreadDeath
error is simply thrown again, and is not passed along.
This class contains the methods to handle exceptions occuring in the {@link org.restlet.ext.jaxrs.JaxRsRestlet}, e.g. while identifying the method that should handle the request.
Therefor it contains some Restlets that handles this exceptions.
Perhaps this class gets again public. Perhaps the special Restlets for handling will be removed, or stay only for 404.
@author Stephan Koopstry {} catch() {}
statement in bytecode.
@author Abe White
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|