Examples of ObjectReference


Examples of org.picocontainer.defaults.ObjectReference

      DefaultFileSystemManager manager = new DefaultFileSystemManager();
      FileObject applicationFolder = getApplicationArchive(manager,  jarsDir + "/malformed-deploy.jar");

      try {
        Deployer deployer = new NanoContainerDeployer(manager);
        ObjectReference containerRef= deployer.deploy(applicationFolder, getClass().getClassLoader(), null);
        fail("Deployment should have thrown FileSystemException for badly formed archive. Instead got:" + containerRef.toString() + " built.");
      }
      catch (FileSystemException ex) {
        //a-ok
      }
    }
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

                container.registerComponentInstance(childStartable.proxy());
            }
        };
        LifecycleContainerBuilder builder = new DefaultLifecycleContainerBuilder(containerComposer);

        ObjectReference parentRef = new SimpleReference();
        MutablePicoContainer parent = new DefaultPicoContainer();

        Mock parentStartable = mock(Startable.class);
        parent.registerComponentInstance(parentStartable.proxy());
        parentRef.set(parent);

        ObjectReference childRef = new SimpleReference();

        builder.buildContainer(childRef, parentRef, null, true);
        PicoContainer childContainer = (PicoContainer) childRef.get();
        //PicoContainer.getParent() is now ImmutablePicoContainer
        assertNotSame(parent, childContainer.getParent());

        builder.killContainer(childRef);
    }
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

        buildContainer(scriptedContainerBuilderFactory, nowait, quiet);
    }


    private static void buildContainer(final ScriptedContainerBuilderFactory scriptedContainerBuilderFactory, boolean nowait, final boolean quiet) {
        final ObjectReference containerRef = new SimpleReference();
        scriptedContainerBuilderFactory.getContainerBuilder().buildContainer(containerRef, null, null, true);

        if (nowait == false) {
            setShutdownHook(quiet, scriptedContainerBuilderFactory, containerRef);
        } else {
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

        FileObject applicationFolder = getApplicationFolder(manager, folderPath);

        try {
            Deployer deployer = null;
            deployer = new NanoContainerDeployer(manager);
            ObjectReference containerRef = deployer.deploy(applicationFolder, getClass().getClassLoader(), null);
            PicoContainer pico = (PicoContainer) containerRef.get();
            Object zap = pico.getComponentInstance("zap");
            assertEquals("Groovy Started", zap.toString());

        } catch (Exception e) {
            e.printStackTrace()
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

        deployer = new NanoContainerDeployer(manager,"foo");
        assertEquals("foo", deployer.getFileBasename());

        try {
            ObjectReference containerRef = deployer.deploy(applicationFolder, getClass().getClassLoader(), null);
            fail("Deployer should have now thrown an exception after changing the base name. Instead got: " + containerRef.toString());
        }
        catch (FileSystemException ex) {
            //a-ok
        }
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

                new ConstantParameter(getClassLoader()) };
        nano.registerComponentImplementation(containerBuilderClassName,
                containerBuilderClassName, parameters);
        ContainerBuilder containerBuilder = (ContainerBuilder) nano
                .getPico().getComponentInstance(containerBuilderClassName);
        ObjectReference parentRef = new SimpleReference();
        parentRef.set(parent);
        containerBuilder.buildContainer(new SimpleReference(), parentRef, null, false);
        return (ContainerPopulator) containerBuilder;
    }
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

    private MutablePicoContainer getActionsContainer() {
        HttpServletRequest request = ServletActionContext.getRequest();
        if ( request != null ) {
            return actionsContainerFactory.getActionsContainer(request);
        } else {
            ObjectReference ref = new ActionContextScopeObjectReference(KeyConstants.REQUEST_CONTAINER);
            return (MutablePicoContainer) ref.get();
        }
    }
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

        }
        return container;
    }

    protected MutablePicoContainer getApplicationContainer(ServletContext context) {
        ObjectReference ref = new ApplicationScopeObjectReference(context, KeyConstants.APPLICATION_CONTAINER);
        return (MutablePicoContainer) ref.get();
    }
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

        ObjectReference ref = new ApplicationScopeObjectReference(context, KeyConstants.APPLICATION_CONTAINER);
        return (MutablePicoContainer) ref.get();
    }

    protected MutablePicoContainer getSessionContainer(HttpSession session) {
        ObjectReference ref = new SessionScopeObjectReference(session, KeyConstants.SESSION_CONTAINER);
        return (MutablePicoContainer) ref.get();
    }
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

        ObjectReference ref = new SessionScopeObjectReference(session, KeyConstants.SESSION_CONTAINER);
        return (MutablePicoContainer) ref.get();
    }

    protected MutablePicoContainer getRequestContainer(ServletRequest request) {
        ObjectReference ref = new RequestScopeObjectReference(request, KeyConstants.REQUEST_CONTAINER);
        return (MutablePicoContainer) ref.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.