On 23.10.2014, at 01:04, Dominik Süß <[email protected]> wrote:
>
> While request.adaptTo(Target.class) would enable an AdapterFactory to get
> hold of the currentResource there is no chance to get the the custom
> resource.
Why not have a setter?
MyModel model = resource.adaptTo(MyModel.class)'
model.setRequest(slingRequest);
or just pass it along with the methods you call, if you only need it in some
calls:
model.doSomething("foo", slingRequest);
IMO it is very important that devs using code are aware that they are using the
request object and are in a request scope or not, so hiding it is not something
you want to strive for.
Cheers,
Alex