Package org.picocontainer.defaults

Examples of org.picocontainer.defaults.SimpleReference


    /**
     *  Mock application stop
     */
    public void stopApplication() {
        SimpleReference ref = new SimpleReference();
        ref.set(applicationContainer);
        containerKiller.killContainer(ref);
        // and reset all the containers
        applicationContainer = null;
        sessionContainer = null;
        requestContainer = null;
View Full Code Here


    /**
     * Mock new session
     */
    public void startSession() {
        SimpleReference ref = new SimpleReference();
        SimpleReference parent = new SimpleReference();
        parent.set(applicationContainer);
        containerBuilder.buildContainer(ref, parent, ((new Mock(HttpSession.class)).proxy()), false);
        sessionContainer = (MutablePicoContainer) ref.get();
    }
View Full Code Here

    /**
     *  Mock session invalidation
     */
    public void stopSession() {
        SimpleReference ref = new SimpleReference();
        ref.set(sessionContainer);
        containerKiller.killContainer(ref);
        sessionContainer = null;
        requestContainer = null;
    }
View Full Code Here

    /**
     *  Mock request start
     */
    public void startRequest() {
        SimpleReference ref = new SimpleReference();
        SimpleReference parent = new SimpleReference();
        parent.set(sessionContainer);
        containerBuilder.buildContainer(ref, parent, (new Mock(HttpServletRequest.class)).proxy(), false);
        requestContainer = (MutablePicoContainer) ref.get();
    }
View Full Code Here

    /**
     * Mock request stop
     */
    public void stopRequest() {
        SimpleReference ref = new SimpleReference();
        ref.set(requestContainer);
        containerKiller.killContainer(ref);
        requestContainer = null;
    }
View Full Code Here

    private PicoContainer buildApplicationContainer(String script, Class containerBuilderClass) throws ClassNotFoundException {
        Mock servletContextMock = mock(ServletContext.class);
        ServletContext context = (ServletContext)servletContextMock.proxy();
        ContainerBuilder containerBuilder = createContainerBuilder(script, containerBuilderClass);
       
        ObjectReference containerRef = new SimpleReference();
        containerBuilder.buildContainer(containerRef, new SimpleReference(), context, false);
        return (PicoContainer) containerRef.get();
    }
View Full Code Here

                new StringReader(script), containerBuilder.getName(), Thread.currentThread().getContextClassLoader());
        return buildContainer(scriptedContainerBuilderFactory.getContainerBuilder());       
    }
   
    private PicoContainer buildContainer(ScriptedContainerBuilder builder) {
        ObjectReference containerRef = new SimpleReference();
        builder.buildContainer(containerRef, new SimpleReference(), new SimpleReference(), false);
        return (PicoContainer) containerRef.get();
    }
View Full Code Here

          ), scope
        ));
        return endpoint;
    }
    private static ObjectReference enref(PicoContainer pico){
        final ObjectReference result = new SimpleReference();
        result.set(pico);
        return result;
    }
View Full Code Here

TOP

Related Classes of org.picocontainer.defaults.SimpleReference

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.