Hi Felix,

I needed some time to catch up, but this concept looks very good to me. With this virtual resource tree and full equivalence of servlets/ filters/services and their scripted equivalents, we are on a good path to a consistent framework.

I second Alex's thought that we need a way of exploring the resource tree however, and that we probably should integrate this a sling bundle that is loaded by default.

regards,

Lars

On 29.12.2007, at 20:51, Felix Meschberger wrote:

Hi all,

After the recent thread on scripting "everything" and some off-line
discussions around this matter, I come to the conclusion, that it is
about time to introduce the Sling Paradigm:

     Everything is a Resource

If Sling would be enhanced to make the ResourceResolver more flexibel
and powerful by the addition of ResourceProvider instances to define a
virtual resource tree accessible (and iterable) through the
ResourceResolver, we can make Sling much more scriptable than it is
today.

The idea is to make servlets and filters registered as OSGi services
available through the ResourceResolver just like normal scripts. The
ServletResolver and Filter handlers could then just ask the
ResourceResolver for resources and adaptTo(Servlet.class) and
adaptTo(Filter.class), resp. Calling scripts from other scripts would
also be available through resolving the script Resource through the
ResourceResolver and adaptTo(SlingScript.class).

Thus we drop the ScriptResolver, while the SerlvetResolver mainly
remains for Sling to be able to handle requests.

Of course the adaptor mechanism must be enhanced to make it extensible.
I propose the definition of a Adaptable interface defining the
adaptTo(Class) method and an AdapterFactory mechanism providing easy
extensibility. This is built after the Eclipse PlatformObject,
IAdapterManager and IAdapterFactory but leverages the OSGi service
registry instead of the Eclipse Plugin mechanism.

I wrote up a wiki page on this concept at [1].

Comments are welcome. I will try to set up a first prototype in the
whiteboard in the next few days.

Regards
Felix

[1] http://cwiki.apache.org/SLING/everything-is-a-resource.html


--
Lars Trieloff
[EMAIL PROTECTED]
http://weblogs.goshaky.com/weblogs/lars

Reply via email to