Package org.nanocontainer.script.xml

Examples of org.nanocontainer.script.xml.XStreamContainerBuilder


    private ObjectReference containerRef = new SimpleReference();

    private ObjectReference parentContainerRef = new SimpleReference();

    protected PicoContainer buildContainer(Reader script) {
        ScriptedContainerBuilder builder = new XStreamContainerBuilder(script,
                getClass().getClassLoader());
        parentContainerRef.set(null);
        builder.buildContainer(containerRef, parentContainerRef, "SOME_SCOPE", true);
        return (PicoContainer) containerRef.get();
    }
View Full Code Here


        requestRecorder = new DefaultContainerRecorder(new DefaultPicoContainer());
        sessionRecorder = new DefaultContainerRecorder(new DefaultPicoContainer());
   
        // create and populate request scope
        InputStreamReader requestScopeScript = new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(REQUEST_CONFIG));
        XStreamContainerBuilder requestPopulator = new XStreamContainerBuilder(requestScopeScript, Thread.currentThread().getContextClassLoader());
        requestPopulator.populateContainer(requestRecorder.getContainerProxy());

        // create and populate session scope
        InputStreamReader sessionScopeScript = new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(SESSION_CONFIG));
        XStreamContainerBuilder sessionPopulator = new XStreamContainerBuilder(sessionScopeScript, Thread.currentThread().getContextClassLoader());
        sessionPopulator.populateContainer(sessionRecorder.getContainerProxy());

    }
View Full Code Here

     @param scope     Description of Parameter
     */
    public void composeContainer(MutablePicoContainer container, Object scope) {
        if (scope instanceof ServletContext) {
            InputStreamReader applicationScopeScript = new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(APPLICATION_CONFIG));
            XStreamContainerBuilder applicationPopulator = new XStreamContainerBuilder(applicationScopeScript, Thread.currentThread().getContextClassLoader());
            applicationPopulator.populateContainer(container);
        } else if (scope instanceof HttpSession) {
            sessionRecorder.replay(container);
        } else if (scope instanceof HttpServletRequest) {
            requestRecorder.replay(container);
        }
View Full Code Here

TOP

Related Classes of org.nanocontainer.script.xml.XStreamContainerBuilder

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.