Examples of SimpleReference


Examples of org.picocontainer.defaults.SimpleReference

            ObjectReference builderRef = new ApplicationScopeObjectReference(context, BUILDER);
            builderRef.set(containerBuilder);

            ObjectReference containerRef = new ApplicationScopeObjectReference(context, APPLICATION_CONTAINER);
            containerBuilder.buildContainer(containerRef, new SimpleReference(), context, false);
        } catch (Exception e) {
            // Not all servlet containers print the nested exception. Do it here.
            event.getServletContext().log(e.getMessage(), e);
            throw new PicoCompositionException(e);
        }
View Full Code Here

Examples of org.picocontainer.defaults.SimpleReference

        String extension = scriptName.substring(scriptName.lastIndexOf('.'));
        return ScriptedContainerBuilderFactory.getBuilderClassName(extension);
    }
   
    protected PicoContainer buildContainer(ScriptedContainerBuilder builder) {
        ObjectReference containerRef = new SimpleReference();
        builder.buildContainer(containerRef, new SimpleReference(), new SimpleReference(), false);
        return (PicoContainer) containerRef.get();
    }
View Full Code Here

Examples of org.picocontainer.defaults.SimpleReference

        containerBuilder.buildContainer(sessionContainerRef, webappContainerRef, session, false);

        session.setAttribute(KILLER_HELPER, new SessionContainerKillerHelper() {
            public void valueBound(HttpSessionBindingEvent bindingEvent) {
                HttpSession session = bindingEvent.getSession();
                containerRef = new SimpleReference();
                containerRef.set(new SessionScopeObjectReference(session, SESSION_CONTAINER).get());
            }

            public void valueUnbound(HttpSessionBindingEvent event) {
                try {
View Full Code Here

Examples of org.picocontainer.defaults.SimpleReference

    /**
     *  Mock application start
     */
    public void startApplication() {
        SimpleReference ref = new SimpleReference();
        containerBuilder.buildContainer(ref, new SimpleReference(), (new Mock(ServletContext.class)).proxy(), false);
        applicationContainer = (MutablePicoContainer) ref.get();
    }
View Full Code Here

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

Examples of org.picocontainer.defaults.SimpleReference

    /**
     * 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

Examples of org.picocontainer.defaults.SimpleReference

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

Examples of org.picocontainer.defaults.SimpleReference

    /**
     *  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

Examples of org.picocontainer.defaults.SimpleReference

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

Examples of org.picocontainer.defaults.SimpleReference

    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
TOP
Copyright © 2018 www.massapi.com. 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.