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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWhenever you use this constructor, be sure to set theLocalRequestProcessorwith 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) voidsetLocalRequestProcessor(LocalRequestProcessor localRequestProcessor)
-
Field Details
-
localRequestProcessor
-
-
Constructor Details
-
LocalRequestDispatcher
public LocalRequestDispatcher()Whenever you use this constructor, be sure to set theLocalRequestProcessorwith the setter provided by this class. If you don't, runtimeNullPointerExceptions 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 runtimeNullPointerExceptionwhenever theLocalRequestDispatcheris used.- Parameters:
localRequestProcessor-
-
-
Method Details
-
dispatchRequest
Description copied from interface:RequestDispatcher- Specified by:
dispatchRequestin interfaceRequestDispatcher- Parameters:
request- TheRequestto be dispatched to aRequestProcessor- Returns:
- The
Responseto be returned from theRequestProcessor
-
getLocalRequestProcessor
-
setLocalRequestProcessor
-