Package org.jboss.arquillian.warp.spi

Examples of org.jboss.arquillian.warp.spi.LifecycleManager


    private <T> T inject(T object) {
        return injector.get().inject(object);
    }

    public void initializeLifecycleManagerAndInspectionRegistry(@Observes BeforeRequest event) {
        LifecycleManager lifecycleManager = inject(new LifecycleManagerImpl());

        manager.set(inject(lifecycleManager));
        registry.set(inject(new InspectionRegistry()));

        event.getRequest().setAttribute(WarpCommons.WARP_REQUEST_LIFECYCLE_MANAGER_ATTRIBUTE, lifecycleManager);
View Full Code Here


        FacesContext facesContext = event.getFacesContext();
        Boolean initialized = (Boolean) facesContext.getAttributes().get(FacesContextFactoryWrapper.WARP_ENABLED);

        if (initialized) {
            try {
                LifecycleManager manager = LifecycleManagerStore.get(FacesContext.class, event.getFacesContext());
                manager.fireEvent(PhaseLifecycleEvent.getInstance(event.getPhaseId(), when));
            } catch (ObjectNotAssociatedException e) {
                throw new IllegalStateException(e);
            }
        }
    }
View Full Code Here

            facesContext = new WrappedFacesContext(facesContext);

            facesContext.getAttributes().put(WARP_ENABLED, Boolean.FALSE);

            try {
                LifecycleManager manager = LifecycleManagerStore.get(ServletRequest.class, httpReq);

                manager.bindTo(FacesContext.class, facesContext);
                facesContext.getAttributes().put(WARP_ENABLED, Boolean.TRUE);

                manager.fireEvent(new FacesContextInitialized(facesContext));
            } catch (ObjectNotAssociatedException e) {
                log.fine("no association of manager found for this ServletRequest");
            } catch (ObjectAlreadyAssociatedException e) {
                throw new IllegalStateException(e);
            }
View Full Code Here

        @Override
        public void release() {
            try {
                if ((Boolean) this.getAttributes().get(WARP_ENABLED)) {
                    LifecycleManager manager = LifecycleManagerStore.get(FacesContext.class, this);

                    manager.unbindFrom(FacesContext.class, this);
                }
            } catch (ObjectNotAssociatedException e) {
                throw new IllegalStateException(e);
            } finally {
                super.release();
View Full Code Here

        Validate.notNull(boundObject, "boundObject must not be null");
        Binding binding = STORE.get(clazz);
        if (binding == null) {
            throw new ObjectNotAssociatedException();
        }
        LifecycleManager manager = binding.get(boundObject);
        if (manager == null) {
            throw new ObjectNotAssociatedException();
        }
        return manager;
    }
View Full Code Here

            facesContext = new WarpFacesContext(facesContext);

            facesContext.getAttributes().put(WARP_ENABLED, Boolean.FALSE);

            try {
                LifecycleManager manager = (LifecycleManager) httpReq.getAttribute(WarpCommons.WARP_REQUEST_LIFECYCLE_MANAGER_ATTRIBUTE);

                if (manager == null) {
                    log.warning("no association of manager found for this ServletRequest");
                    return facesContext;
                }

                manager.bindTo(FacesContext.class, facesContext);
                facesContext.getAttributes().put(WARP_ENABLED, Boolean.TRUE);
                facesContext.getAttributes().put(WarpJSFCommons.WARP_REQUEST_LIFECYCLE_MANAGER_ATTRIBUTE, manager);

                manager.fireEvent(new FacesContextInitialized(facesContext));
            } catch (ObjectAlreadyAssociatedException e) {
                throw new IllegalStateException(e);
            }
        }
View Full Code Here

        public void release() {
            try {
                if ((Boolean) this.getAttributes().get(WARP_ENABLED)) {
                    WarpFacesContext context = WarpFacesContext.getInstance(this);

                    LifecycleManager manager = LifecycleManagerStore.get(FacesContext.class, context);
                    manager.unbindFrom(FacesContext.class, context);
                    context.getAttributes().remove(WarpJSFCommons.WARP_REQUEST_LIFECYCLE_MANAGER_ATTRIBUTE);
                }
            } catch (ObjectNotAssociatedException e) {
                throw new IllegalStateException(e);
            } finally {
View Full Code Here

        FacesContext facesContext = event.getFacesContext();
        Boolean initialized = (Boolean) facesContext.getAttributes().get(FacesContextFactory.WARP_ENABLED);

        if (initialized) {
            try {
                LifecycleManager manager = LifecycleManagerStore.get(FacesContext.class, WarpFacesContext.getInstance(event.getFacesContext()));
                manager.fireEvent(PhaseLifecycleEvent.getInstance(event.getPhaseId(), when));
            } catch (ObjectNotAssociatedException e) {
                throw new IllegalStateException(e);
            }
        }
    }
View Full Code Here

            HttpServletRequest httpReq = (HttpServletRequest) request;

            facesContext.getAttributes().put(WARP_ENABLED, Boolean.FALSE);

            try {
                LifecycleManager manager = LifecycleManagerStore.get(ServletRequest.class, httpReq);

                manager.bindTo(FacesContext.class, facesContext);
                facesContext.getAttributes().put(WARP_ENABLED, Boolean.TRUE);

                manager.fireEvent(new FacesContextInitialized(facesContext));
            } catch (ObjectNotAssociatedException e) {
                log.fine("no association of manager found for this ServletRequest");
            } catch (ObjectAlreadyAssociatedException e) {
                throw new IllegalStateException(e);
            }
View Full Code Here

        @Override
        public void release() {
            try {
                if ((Boolean) this.getAttributes().get(WARP_ENABLED)) {
                    LifecycleManager manager = LifecycleManagerStore.get(FacesContext.class, this);

                    manager.unbindFrom(FacesContext.class, this);
                }
            } catch (ObjectNotAssociatedException e) {
                throw new IllegalStateException(e);
            } finally {
                super.release();
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.warp.spi.LifecycleManager

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.