Package org.nanocontainer.script

Examples of org.nanocontainer.script.ScriptedContainerBuilderFactory


        if (builderClassName == null) {
          throw new FileSystemException("Could not find a suitable builder for: " + deploymentScript.getName()
              + ".  Known extensions are: [groovy|bsh|js|py|xml]");
        }

        ScriptedContainerBuilderFactory scriptedContainerBuilderFactory = new ScriptedContainerBuilderFactory(scriptReader, builderClassName, applicationClassLoader);
        ContainerBuilder builder = scriptedContainerBuilderFactory.getContainerBuilder();
        builder.buildContainer(result, parentContainerRef, null, true);

        return result;
    }
View Full Code Here


    monitor/InvocationInterceptor to use.

    AH
    */
    private static void buildAndStartContainer(URL composition, final boolean quiet, boolean nowait) throws ClassNotFoundException {
        final ScriptedContainerBuilderFactory scriptedContainerBuilderFactory = new ScriptedContainerBuilderFactory(composition);
        buildContainer(scriptedContainerBuilderFactory, nowait, quiet);
    }
View Full Code Here

        final ScriptedContainerBuilderFactory scriptedContainerBuilderFactory = new ScriptedContainerBuilderFactory(composition);
        buildContainer(scriptedContainerBuilderFactory, nowait, quiet);
    }

    private static void buildAndStartContainer(File composition, boolean quiet, boolean nowait) throws IOException, ClassNotFoundException {
        final ScriptedContainerBuilderFactory scriptedContainerBuilderFactory = new ScriptedContainerBuilderFactory(composition);
        buildContainer(scriptedContainerBuilderFactory, nowait, quiet);
    }
View Full Code Here

                    // the script isn't inlined, but in a separate file.
                    scriptReader = new InputStreamReader(context.getResourceAsStream(script));
                } else {
                    scriptReader = new StringReader(script);
                }
                ScriptedContainerBuilderFactory scriptedContainerBuilderFactory = new ScriptedContainerBuilderFactory(scriptReader, builderClassName, Thread.currentThread().getContextClassLoader());
                return scriptedContainerBuilderFactory.getContainerBuilder();
            }
            if (initParameter.equals(CONTAINER_COMPOSER)) {
                ContainerComposer containerComposer = createContainerComposer(context);
                return new DefaultLifecycleContainerBuilder(containerComposer);
            }
View Full Code Here

        String script = context.getInitParameter(CONTAINER_COMPOSER_CONFIGURATION);
        PicoContainer picoConfiguration = null;
        if ( script != null ){
            Reader scriptReader = new InputStreamReader(context.getResourceAsStream(script));
            String builderClassName = getBuilderClassName(script);
            ScriptedContainerBuilderFactory scriptedContainerBuilderFactory = new ScriptedContainerBuilderFactory(scriptReader, builderClassName, Thread.currentThread().getContextClassLoader());
            picoConfiguration = buildContainer(scriptedContainerBuilderFactory.getContainerBuilder());
        }
        ComponentAdapter componentAdapter = null;
        if ( picoConfiguration != null ){
            Parameter[] parameters = new Parameter[]{ new ConstantParameter(picoConfiguration) };
            componentAdapter = nanoContainer.registerComponentImplementation(containerComposerClassName, containerComposerClassName, parameters);
View Full Code Here

        containerBuilder.buildContainer(containerRef, new SimpleReference(), context, false);
        return (PicoContainer) containerRef.get();
    }

    private ContainerBuilder createContainerBuilder(String script, Class containerBuilderClass) throws ClassNotFoundException {
        ScriptedContainerBuilderFactory scriptedContainerBuilderFactory =
            new ScriptedContainerBuilderFactory(new StringReader(script), containerBuilderClass.getName(),
                    Thread.currentThread().getContextClassLoader());
        return (ContainerBuilder)scriptedContainerBuilderFactory.getContainerBuilder();
    }
View Full Code Here

        assertNotNull(requestContainer.getComponentInstance("testFooHierarchy"));
    }
   

    private PicoContainer createConfigurationContainer(String script, Class containerBuilder) throws ClassNotFoundException{
        ScriptedContainerBuilderFactory scriptedContainerBuilderFactory = new ScriptedContainerBuilderFactory(
                new StringReader(script), containerBuilder.getName(), Thread.currentThread().getContextClassLoader());
        return buildContainer(scriptedContainerBuilderFactory.getContainerBuilder());       
    }
View Full Code Here

TOP

Related Classes of org.nanocontainer.script.ScriptedContainerBuilderFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.