Currently the implementation of groovy.lang.Script keeps the binding (= the parameters you pass to the script) as a member variable. One could call it a feature ... :-(
Running a script with two threads would overwrite the parameters passed to the script. Therefore the Groovy Service uses semaphore to enforce the single-threaded execution of a Groovy script. This still allows executing different scipts in parallel with multiple threads.
The locator gives you easy customization of Groovy scripts. Let's say you would like to invoke the script 'magic.groovy' for a customer 'ABC' and 'XYZ' using the following script layout
scripts -- magic.groovy -- ABC -- magic.groovy
In the case of invoking 'ABC/magic.groovy' the script 'ABC/magic.groovy' would be executed. In the case of invoking 'XYZ/magic.groovy' the locator is looking for 'XYZ/magic.groovy'. Since it isn't found it steps up a directory to execute 'magic.groovy'. The trick was taken from the Fulcrum XSLT service which uses a simlilar fallback mechanism.
The Groovy scripts are managesd by the Fulcrum ResourcManager Service. In the future this might allow to store the Groovy Scripts in a database.