org.objectweb.proactive.core.component.controller
Interface RequestHandler

All Known Implementing Classes:
AbstractRequestHandler

public interface RequestHandler

A RequestHandler is able to control the flow of a component request in a chain of handlers. If the request can be handled by the current handler, then it is executed here, otherwise it is passed to the next handler in the chain of handlers.

Author:
Matthieu Morel

Method Summary
 java.lang.Object handleRequest(ComponentRequest request)
          If the current controller is suitable, the request is executed.
 RequestHandler nextHandler()
           
 void setNextHandler(RequestHandler handler)
          Sets the next handler in the chain of handlers.
 

Method Detail

handleRequest

public java.lang.Object handleRequest(ComponentRequest request)
                               throws MethodCallExecutionFailedException,
                                      java.lang.reflect.InvocationTargetException
If the current controller is suitable, the request is executed. If not executed, it is passed to the next handler.

Parameters:
request - the request to process
Returns:
the result of the request
Throws:
MethodCallExecutionFailedException - if the execution of a request failed (ProActive level)
java.lang.reflect.InvocationTargetException - if the execution of a request failed (java reflection level)

nextHandler

public RequestHandler nextHandler()
Returns:
the next handler in the chain, or null

setNextHandler

public void setNextHandler(RequestHandler handler)
Sets the next handler in the chain of handlers.

Parameters:
handler - the next handler in the chain of handlers.


Copyright 2001-2005 INRIA All Rights Reserved.