Examples of ObjectReference


Examples of org.picocontainer.defaults.ObjectReference

    public void contextInitialized(ServletContextEvent event) {
        ServletContext context = event.getServletContext();
        try {
            ContainerBuilder containerBuilder = createContainerBuilder(context);

            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.ObjectReference

        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.ObjectReference

        return (PicoContainer) containerRef.get();
    }
   
    public void contextDestroyed(ServletContextEvent event) {
        ServletContext context = event.getServletContext();
        ObjectReference containerRef = new ApplicationScopeObjectReference(context, APPLICATION_CONTAINER);
        killContainer(containerRef);
    }
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

    public void sessionCreated(HttpSessionEvent event) {
        HttpSession session = event.getSession();
        ServletContext context = session.getServletContext();
        ContainerBuilder containerBuilder = getBuilder(context);
        ObjectReference sessionContainerRef = new SessionScopeObjectReference(session, SESSION_CONTAINER);
        ObjectReference webappContainerRef = new ApplicationScopeObjectReference(context, APPLICATION_CONTAINER);
        containerBuilder.buildContainer(sessionContainerRef, webappContainerRef, session, false);

        session.setAttribute(KILLER_HELPER, new SessionContainerKillerHelper() {
            public void valueBound(HttpSessionBindingEvent bindingEvent) {
                HttpSession session = bindingEvent.getSession();
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

    public void sessionDestroyed(HttpSessionEvent event) {
        // no implementation - session scoped container killed by SessionContainerKillerHelper
    }

    private ContainerBuilder getBuilder(ServletContext context) {
        ObjectReference assemblerRef = new ApplicationScopeObjectReference(context, BUILDER);
        return (ContainerBuilder) assemblerRef.get();
    }
View Full Code Here

Examples of org.picocontainer.defaults.ObjectReference

        }
        return servletPath;
    }

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

Examples of org.picocontainer.defaults.ObjectReference

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

    private MutablePicoContainer getRequestContainer(ServletRequest request) {
        ObjectReference ref = new RequestScopeObjectReference(request, REQUEST_CONTAINER);
        return (MutablePicoContainer) ref.get();
    }
View Full Code Here

Examples of org.vmmagic.unboxed.ObjectReference

        size += this.headerSize;
        final Address ptr = alloc(size, align, this.headerSize, allocator);

        // Initialize the header
        final Address objPtr = ptr.add(headerSize);
        final ObjectReference tibRef = ObjectReference.fromObject(vmClass
                .getTIB());
        objPtr.store(tibRef, tibOffset);
        objPtr.store((int) 0, flagsOffset);

        // Post allocation
View Full Code Here

Examples of org.vmmagic.unboxed.ObjectReference

            // We already own this lock, increment the lock count.
            lockCount = lockCount.add(Word.one());
        } else {
            final Address ownerAddr = ObjectReference.fromObject(this)
                .toAddress();
            final ObjectReference procRef = ObjectReference.fromObject(VmMagic
                .currentProcessor());
            while (!ownerAddr.attempt(null, procRef)) {
                // Busy wait
            }
            // Now I'm the owner
View Full Code Here

Examples of org.vmmagic.unboxed.ObjectReference

        println("getSelector point A");
        if (obj == null)
            return -1;

        println("getSelector point B");
        ObjectReference objRef = ObjectReference.fromObject(obj);

        println("getSelector point C");
        return (objRef == null) ? null : getSelector(objRef.toAddress());
    }
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.