On Jan 17, 2008 9:19 PM, Felix Meschberger <[EMAIL PROTECTED]> wrote:
> ...I finally somewhat finished the prototype implementation of the
> "Everything is a Resource" concept and updated the wiki page....
Thanks for this - I've had a look and I like what I see!
One thing that came to mind: [1] lists a number of properties
(sling.servlet.paths, sling.servlet.resourceTypes, etc.) used in
resolving Servlets.
I'm not sure if the range of "servlet selection properties" covers all
cases - in some (rare but useful) cases it might be needed fo a
Servlet to decide, by itself, if it can process the current request or
not, by applying more complex rules that those properties allow.
For some cases, I think it might be useful to create an interface like:
interface CanProcessRequestDecision {
boolean canProcess(SlingHttpServletRequest r);
}
that the class which resolves Servlets can use, to have a fully
flexible selection mechanism. Most servlets won't implement this
interface, so the normal case just needs an instanceof check to decide
whether to use this or not.
Would that fit into your design, if/when we need that?
Also, is there any notion of priorities in Resource resolution in your
design? I'm a bit worried about being dependent on the loading order
of OSGi bundles, for example, in cases where two Servlets from
different bundles have the same set of selection properties.
-Bertrand
[1] http://cwiki.apache.org/confluence/display/SLING/Everything+is+a+Resource