Examples of WebContinuation


Examples of org.apache.cocoon.components.flow.WebContinuation

     * settings in the sitemap.
     */
    public static FormsPipelineConfig createConfig(Map objectModel, Parameters parameters) {
        // create and set the jxpathContext...
        Object flowContext = FlowHelper.getContextObject(objectModel);
        WebContinuation wk = FlowHelper.getWebContinuation(objectModel);
        JXPathContext jxpc = JXPathContext.newContext(flowContext);
        // We manually create a cocoon object here to provide the same way
        // of accessing things as in the jxtg
        // as soon as we have our unified om, we should use that
        Request request = ObjectModelHelper.getRequest(objectModel);
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

        }
        context.setParameters(parameters);

        Continuation continuation = new Continuation(context);

        WebContinuation wk = continuationsMgr.createWebContinuation(
                continuation, null, timeToLive, getInterpreterID(), null);
        FlowHelper.setWebContinuation(ContextHelper.getObjectModel(this.avalonContext), wk);

        continuation.registerThread();
        try {
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

    public void handleContinuation(String id, List params, Redirector redirector)
            throws Exception {
        if (!initialized)
            initialize();

        WebContinuation parentwk = continuationsMgr.lookupWebContinuation(id, getInterpreterID());

        if (parentwk == null) {
            /*
             * Throw an InvalidContinuationException to be handled inside the
             * <map:handle-errors> sitemap element.
             */
            throw new InvalidContinuationException("The continuation ID " + id + " is invalid.");
        }

        Continuation parentContinuation = (Continuation) parentwk.getContinuation();
        ContinuationContext parentContext = (ContinuationContext) parentContinuation.getContext();
        ContinuationContext context = new ContinuationContext();
        context.setObject(parentContext.getObject());
        context.setMethod(parentContext.getMethod());
        context.setAvalonContext(avalonContext);
        context.setLogger(getLogger());
        context.setServiceManager(manager);
        context.setRedirector(redirector);
        Parameters parameters = new Parameters();
        for(Iterator i=params.iterator(); i.hasNext();) {
            Argument argument = (Argument)i.next();
            parameters.setParameter(argument.name, argument.value);
        }
        context.setParameters(parameters);

        Continuation continuation = new Continuation(parentContinuation, context);

        Request request = ContextHelper.getRequest(this.avalonContext);
        Session session = request.getSession(true);
        HashMap userScopes = (HashMap) session.getAttribute(USER_GLOBAL_SCOPE);

        Continuable flow = (Continuable) context.getObject();
        Method method = context.getMethod();

        WebContinuation wk = continuationsMgr.createWebContinuation(
                continuation, parentwk, timeToLive, getInterpreterID(), null);
        FlowHelper.setWebContinuation(ContextHelper.getObjectModel(this.avalonContext), wk);

        continuation.registerThread();
        try {
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

        Redirector redirector)
        throws Exception {

        AppleController app = instantiateController(className);

        WebContinuation wk = null;
        if (!(app instanceof StatelessAppleController)) {
            wk = this.continuationsMgr.createWebContinuation(app, null, 0,
                    getInterpreterID(), this);
            if (getLogger().isDebugEnabled())
                getLogger().debug("Instantiated a stateful apple, continuationid = " + wk.getId());
        }

        DefaultContext appleContext = new DefaultContext(avalonContext);
        if (wk != null) {
        appleContext.put("continuation-id", wk.getId());
        }
       
        LifecycleHelper.setupComponent( app, getLogger(), appleContext,
                                        this.serviceManager, new WrapperComponentManager(this.serviceManager)
                                        null, null, true);
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

        String continuationId,
        List params,
        Redirector redirector)
        throws Exception {

        WebContinuation wk =
            this.continuationsMgr.lookupWebContinuation(continuationId, getInterpreterID());
        if (wk == null) {
            // Throw an InvalidContinuationException to be handled inside the
            // <map:handle-errors> sitemap element.
            throw new InvalidContinuationException(
                "The continuation ID " + continuationId + " is invalid.");
        }

        AppleController app =
            (AppleController) wk.getContinuation();

        getLogger().debug("found apple from continuation: " + app);

        // TODO access control checks? exception to be thrown for illegal access?
        processApple(params, redirector, app, wk);
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

        Redirector redirector)
        throws Exception {

        AppleController app = instantiateController(className);

        WebContinuation wk = this.continuationsMgr.createWebContinuation(app, null, 0, this);

        DefaultContext appleContext = new DefaultContext();
        appleContext.put("continuation-id", wk.getId());

        getLogger().debug("Pulling fresh apple through the lifecycle... | continuationid=" + wk.getId());
       
        LifecycleHelper.setupComponent( app, getLogger(), appleContext,
                                        this.serviceManager, new WrapperComponentManager(this.serviceManager)
                                        null, null, true);
       
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

        String continuationId,
        List params,
        Redirector redirector)
        throws Exception {

        WebContinuation wk =
            this.continuationsMgr.lookupWebContinuation(continuationId);
        if (wk == null) {
            // Throw an InvalidContinuationException to be handled inside the
            // <map:handle-errors> sitemap element.
            throw new InvalidContinuationException(
                "The continuation ID " + continuationId + " is invalid.");
        }

        AppleController app =
            (AppleController) wk.getContinuation();

        getLogger().debug("found apple from continuation: " + app);

        // TODO access control checks? exception to be thrown for illegal access?
        processApple(params, redirector, app, wk);
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

     * settings in the sitemap.
     */
    public static WoodyPipelineConfig createConfig(Map objectModel, Parameters parameters) {
        // create and set the jxpathContext...
        Object flowContext = FlowHelper.getContextObject(objectModel);
        WebContinuation wk = FlowHelper.getWebContinuation(objectModel);
        JXPathContext jxpc = JXPathContext.newContext(flowContext);
        Variables vars = jxpc.getVariables();
        vars.declareVariable("continuation", wk);
        Request request = ObjectModelHelper.getRequest(objectModel);
        vars.declareVariable("request", request);
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

        // FIXME: Initialize the Velocity context. Use objectModel to pass these
        final Object bean = FlowHelper.getContextObject(objectModel);
        if (bean != null) {

            final WebContinuation kont = FlowHelper.getWebContinuation(objectModel);

            // Hack? I use JXPath to determine the properties of the bean object
            final JXPathBeanInfo bi = JXPathIntrospector.getBeanInfo(bean.getClass());
            DynamicPropertyHandler h = null;
            final PropertyDescriptor[] props;
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

    /**
     * Return this continuation if it is valid, or first valid parent
     */
    private FOM_WebContinuation findValidParent(FOM_WebContinuation wk) {
        if (wk != null) {
            WebContinuation wc = wk.getWebContinuation();
            while (wc != null && wc.disposed()) {
                wc = wc.getParentContinuation();
            }
            if (wc != null) {
                return new FOM_WebContinuation(wc);
            }
        }
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.