On Tue, Nov 3, 2009 at 22:16, Jerome
Velociter<jerome(a)xwiki.com> wrote:
Hello all,
We need to be able to expose APIs to scripting languages. Following the
idea initially expressed by Vincent in this thread
http://lists.xwiki.org/pipermail/devs/2009-August/013934.html, I would
like to propose the following :
- We add a org.xwiki.script.ScriptService component role, which is an
empty tag interface that services class implements
- A org.xwiki.script.ScriptServiceManager implementation gets all
services injected in a roleHint/service map
Having a roleHint/service map is already CM job, no need to have one
in ScriptServiceManager, use lookup when a service is asked. It make
code more simple and support registration/unregistration of service at
runtime.
Fine with me. I thought this was a bit overhead compared to creating all
services instances the first time by getting the whole map injected. I
agree the runtime registration is nice.
Jerome.
- This script service manager gets injected where
script bindings are
initialized and is bound "as is" with under "services" name.
Currently
in two places : in the XWikiScriptContextInitializer and in the
DefaultVelocityManager (since velocity is treated separetely from JSR223
scripting languages for the moment).
I've uploaded an initial patch on
http://jira.xwiki.org/jira/browse/XWIKI-4551 if you want to give a look.
My +1
Except for the ScriptServiceManager Map, +1
Jerome.
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs