Interface Resource
-
public interface Resource
AResource
provides an abstraction of any given object that can be retrieved using a HTTP request. The reason for having this abstraction is to simplify the interface with any givenResource
.This is similar in design to a
Container
, however this is intended to handle a single resource. At any time a container may manage many resources all of which are resolved using aResourceEngine
implementation. So in essence this is used to identify a component that can handle a HTTP request routed by a resource engine.- Author:
- Niall Gallagher
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
handle(Request req, Response resp)
This acts as the main processing method for the resources.
-
-
-
Method Detail
-
handle
void handle(Request req, Response resp)
This acts as the main processing method for the resources. Implementations are required to provide the functions that will process theRequest
and generate a suitable response for that request. This method is also responsible for closing and comitting theResponse
unless handed (chained) to anotherResource
.- Parameters:
req
- theRequest
to be processedresp
- theResponse
to be processed
-
-