All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.directwebremoting.dwrp.ResumeContinuationScriptConduit Maven / Gradle / Ivy

Go to download

DWR is easy Ajax for Java. It makes it simple to call Java code directly from Javascript. It gets rid of almost all the boiler plate code between the web browser and your Java code.

There is a newer version: 3.0.2-RELEASE
Show newest version
package org.directwebremoting.dwrp;

import org.directwebremoting.ScriptBuffer;
import org.directwebremoting.extend.ScriptConduit;
import org.directwebremoting.util.Continuation;
import org.directwebremoting.util.Logger;

/**
 * Implementaion of ScriptConduit that just resumes a continuation.
 */
public class ResumeContinuationScriptConduit extends ScriptConduit
{
    /**
     * @param continuation
     */
    public ResumeContinuationScriptConduit(Continuation continuation)
    {
        super(RANK_PROCEDURAL);
        this.continuation = continuation;
    }

    /* (non-Javadoc)
     * @see org.directwebremoting.ScriptConduit#addScript(org.directwebremoting.ScriptBuffer)
     */
    public boolean addScript(ScriptBuffer script)
    {
        try
        {
            continuation.resume();
        }
        catch (Exception ex)
        {
            log.warn("Exception in continuation.resume()", ex);
        }

        // never actually handle the script!
        return false;
    }

    /**
     * The log stream
     */
    private static final Logger log = Logger.getLogger(ResumeContinuationScriptConduit.class);

    /**
     * The Jetty continuation
     */
    private final Continuation continuation;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy