KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > directwebremoting > extend > RealScriptSession


1 /*
2  * Copyright 2005 Joe Walker
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.directwebremoting.extend;
17
18 import java.io.IOException JavaDoc;
19
20 import org.directwebremoting.ScriptSession;
21
22 /**
23  * RealScriptSession is the real interface that should be implemented in place
24  * of ScriptSession. It includes methods required by the guts of DWR, that are
25  * not needed by normal users.
26  * @author Joe Walker [joe at getahead dot ltd dot uk]
27  */

28 public interface RealScriptSession extends ScriptSession
29 {
30     /**
31      * While a Marshaller is processing a request it can register a
32      * ScriptConduit with the ScriptSession to say - "pass scripts to me"
33      * <p>
34      * Several Marshallers may be active on the same page as a time and it
35      * doesn't really matter which gets the script. So ScriptSession should
36      * record all of the active ScriptConduits, but just pick one
37      * @param conduit The new ScriptConduit
38      * @throws IOException If the write to the output fails
39      * @see RealScriptSession#removeScriptConduit(ScriptConduit)
40      */

41     void addScriptConduit(ScriptConduit conduit) throws IOException JavaDoc;
42
43     /**
44      * Remove a ScriptConduit.
45      * @param conduit The ScriptConduit to remove
46      * @see RealScriptSession#addScriptConduit(ScriptConduit)
47      */

48     void removeScriptConduit(ScriptConduit conduit);
49
50     /**
51      * We might need to send a script directly to a conduit without adding the
52      * conduit to the "open" list and then removing it directly.
53      * @param conduit The conduit to write to
54      * @throws IOException If writing fails
55      */

56     void writeScripts(ScriptConduit conduit) throws IOException JavaDoc;
57
58     /**
59      * Allows for checking to see if there is data waiting to be returned
60      * @return true if there are no waiting scripts
61      */

62     boolean hasWaitingScripts();
63
64     /**
65      * Accessor for an object that we use to announce to people that might be
66      * waiting on output from this ScriptSession that there is some output
67      * ready for action.
68      * TODO: Replace this with a listener mechanism
69      * @return The mutex object used by the script session
70      */

71     Object JavaDoc getScriptLock();
72 }
73
Popular Tags