Interface Resource
public interface Resource
A
Resource
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 given Resource
.
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 a ResourceEngine
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
-
Method Details
-
handle
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
-