org.picocontainer.script.groovy
Class GroovyContainerBuilder

java.lang.Object
  extended by org.picocontainer.script.AbstractContainerBuilder
      extended by org.picocontainer.script.ScriptedContainerBuilder
          extended by org.picocontainer.script.groovy.GroovyContainerBuilder
All Implemented Interfaces:
ContainerBuilder

public class GroovyContainerBuilder
extends ScriptedContainerBuilder

The groovy script has to return an instance of ClassLoadingPicoContainer. There is an implicit variable named "parent" that may contain a reference to a parent container.

Author:
Paul Hammant, Aslak Hellesøy, Mauro Talevi

Constructor Summary
GroovyContainerBuilder(Reader script, ClassLoader classLoader)
           
GroovyContainerBuilder(Reader script, ClassLoader classLoader, LifecycleMode lifecycleMode)
           
GroovyContainerBuilder(URL script, ClassLoader classLoader)
           
GroovyContainerBuilder(URL script, ClassLoader classLoader, LifecycleMode lifecycleMode)
           
 
Method Summary
protected  org.picocontainer.PicoContainer createContainerFromScript(org.picocontainer.PicoContainer parentContainer, Object assemblyScope)
           
protected  groovy.lang.GroovyObject createNodeBuilder()
          Allows customization of the groovy node builder in descendants.
protected  void handleBinding(groovy.lang.Binding binding)
          This allows children of this class to add to the default binding.
 
Methods inherited from class org.picocontainer.script.ScriptedContainerBuilder
createContainer, getClassLoader, getScriptInputStream, getScriptReader
 
Methods inherited from class org.picocontainer.script.AbstractContainerBuilder
autoStart, buildContainer, killContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyContainerBuilder

public GroovyContainerBuilder(Reader script,
                              ClassLoader classLoader)

GroovyContainerBuilder

public GroovyContainerBuilder(Reader script,
                              ClassLoader classLoader,
                              LifecycleMode lifecycleMode)

GroovyContainerBuilder

public GroovyContainerBuilder(URL script,
                              ClassLoader classLoader)

GroovyContainerBuilder

public GroovyContainerBuilder(URL script,
                              ClassLoader classLoader,
                              LifecycleMode lifecycleMode)
Method Detail

createContainerFromScript

protected org.picocontainer.PicoContainer createContainerFromScript(org.picocontainer.PicoContainer parentContainer,
                                                                    Object assemblyScope)
Specified by:
createContainerFromScript in class ScriptedContainerBuilder

createNodeBuilder

protected groovy.lang.GroovyObject createNodeBuilder()
Allows customization of the groovy node builder in descendants.

Returns:
GroovyNodeBuilder

handleBinding

protected void handleBinding(groovy.lang.Binding binding)
This allows children of this class to add to the default binding. Might want to add similar or a more generic implementation of this method to support the other scripting languages.

Parameters:
binding - the binding


Copyright © 2003-2010 Codehaus. All Rights Reserved.