Package org.rribbit.dispatching
Class LocalRequestDispatcher
java.lang.Object
org.rribbit.dispatching.LocalRequestDispatcher
- All Implemented Interfaces:
RequestDispatcher
This
RequestDispatcher
dispatches a Request
on a local machine to a LocalRequestProcessor
via a simple Java method call.- Author:
- G.J. Schouten
-
Field Summary
-
Constructor Summary
ConstructorDescriptionWhenever you use this constructor, be sure to set theLocalRequestProcessor
with the setter provided by this class.LocalRequestDispatcher
(LocalRequestProcessor localRequestProcessor) This constructor is recommended, since it forces you to specify theLocalRequestProcessor
. -
Method Summary
Modifier and TypeMethodDescription<T> Response
<T> dispatchRequest
(Request request) void
setLocalRequestProcessor
(LocalRequestProcessor localRequestProcessor)
-
Field Details
-
localRequestProcessor
-
-
Constructor Details
-
LocalRequestDispatcher
public LocalRequestDispatcher()Whenever you use this constructor, be sure to set theLocalRequestProcessor
with the setter provided by this class. If you don't, runtimeNullPointerException
s will occur. -
LocalRequestDispatcher
This constructor is recommended, since it forces you to specify theLocalRequestProcessor
. Passing a null value for either of these will result in a runtimeNullPointerException
whenever theLocalRequestDispatcher
is used.- Parameters:
localRequestProcessor
-
-
-
Method Details
-
dispatchRequest
Description copied from interface:RequestDispatcher
- Specified by:
dispatchRequest
in interfaceRequestDispatcher
- Parameters:
request
- TheRequest
to be dispatched to aRequestProcessor
- Returns:
- The
Response
to be returned from theRequestProcessor
-
getLocalRequestProcessor
-
setLocalRequestProcessor
-