All Implemented Interfaces:
Handler
public abstract class DelegatingHandler
extends Object
implements Handler
Template for a class which has a list of handlers that it tries
in order.
Constructor Summary
Constructors
Method Summary
All Methods Instance Methods Concrete Methods
handle (org.microhttp.Request request)
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
Constructor Details
DelegatingHandler
Parameters:
handlers - The list of handlers, in the order they should be tried.
notHandled - The IntoResponse to use if no handler matches the request.
Method Details
handle
Description copied from interface: Handler
Handles the request.
If null is returned, that means that the handler is signaling that it does
not want to handle the Request. This would signal that another Handler should
be consulted or a default response should be used
Specified by:
handle in interface Handler
Parameters:
request - The request to handle.
Returns:
Something which can be converted into a response or null.
Throws:
Exception - If something goes wrong.