public interface Resource
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.
void handle(Request req, Response resp)
Request
and generate a suitable
response for that request. This method is also responsible
for closing and comitting the Response
unless
handed (chained) to another Resource
.req
- the Request
to be processedresp
- the Response
to be processed