KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > directwebremoting > dwrp > ResumeContinuationScriptConduit


1 package org.directwebremoting.dwrp;
2
3 import org.directwebremoting.ScriptBuffer;
4 import org.directwebremoting.extend.ScriptConduit;
5 import org.directwebremoting.util.Continuation;
6 import org.directwebremoting.util.Logger;
7
8 /**
9  * Implementaion of ScriptConduit that just resumes a continuation.
10  */

11 public class ResumeContinuationScriptConduit extends ScriptConduit
12 {
13     /**
14      * @param continuation
15      */

16     public ResumeContinuationScriptConduit(Continuation continuation)
17     {
18         super(RANK_PROCEDURAL);
19         this.continuation = continuation;
20     }
21
22     /* (non-Javadoc)
23      * @see org.directwebremoting.ScriptConduit#addScript(org.directwebremoting.ScriptBuffer)
24      */

25     public boolean addScript(ScriptBuffer script)
26     {
27         try
28         {
29             continuation.resume();
30         }
31         catch (Exception JavaDoc ex)
32         {
33             log.warn("Exception in continuation.resume()", ex);
34         }
35
36         // never actually handle the script!
37
return false;
38     }
39
40     /**
41      * The log stream
42      */

43     private static final Logger log = Logger.getLogger(ResumeContinuationScriptConduit.class);
44
45     /**
46      * The Jetty continuation
47      */

48     private final Continuation continuation;
49 }
Popular Tags