Source Code Cross Referenced for OpenAjax.java in  » Ajax » dwr » org » directwebremoting » proxy » openajax » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » dwr » org.directwebremoting.proxy.openajax 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005 Joe Walker
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.directwebremoting.proxy.openajax;
017:
018:        import java.util.Collection;
019:
020:        import org.directwebremoting.ScriptSession;
021:        import org.directwebremoting.event.PublishListener;
022:        import org.directwebremoting.proxy.ScriptProxy;
023:
024:        /**
025:         * Util is a server-side proxy that allows Java programmers to call client
026:         * side Javascript from Java.
027:         * <p>
028:         * Each Util object is associated with a list of ScriptSessions and the
029:         * proxy code is creates will be dynamically forwarded to all those browsers.
030:         * <p>
031:         * Currently this class contains only the write-only DOM manipulation functions
032:         * from Util. It is possible that we could add the read methods, however
033:         * the complexity in the callback and the fact that you are probably not going
034:         * to need it means that we'll leave it for another day. Specifically,
035:         * <code>getValue</code>, <code>getValues</code> and <code>getText</code> have
036:         * been left out as being read functions and <code>useLoadingMessage</code> etc
037:         * have been left out as not being DOM related.
038:         * @author Joe Walker [joe at getahead dot ltd dot uk]
039:         * @author Jorge Martin Cuervo [darthkorr at gmail dot com]
040:         */
041:        public class OpenAjax extends ScriptProxy {
042:            /**
043:             * Http thread constructor, that affects no browsers.
044:             * Calls to {@link OpenAjax#addScriptSession(ScriptSession)} or to
045:             * {@link OpenAjax#addScriptSessions(Collection)} will be needed  
046:             */
047:            public OpenAjax() {
048:                super ();
049:            }
050:
051:            /**
052:             * Http thread constructor that alters a single browser
053:             * @param scriptSession The browser to alter
054:             */
055:            public OpenAjax(ScriptSession scriptSession) {
056:                super (scriptSession);
057:            }
058:
059:            /**
060:             * Http thread constructor that alters a number of browsers
061:             * @param scriptSessions A collection of ScriptSessions that we should act on.
062:             */
063:            public OpenAjax(Collection<ScriptSession> scriptSessions) {
064:                super (scriptSessions);
065:            }
066:
067:            /**
068:             * Publishes (broadcasts) an event based on a library-specific prefix and
069:             * event name.
070:             * @param prefix The prefix that corresponds to this event. This must be a
071:             * prefix that has been registered via OpenAjax.registerLibrary().
072:             * @param name The name of the event to listen for. Names can be any string
073:             */
074:            public void publish(String prefix, String name) {
075:                addFunctionCall("OpenAjax.publish", prefix, name);
076:            }
077:
078:            /**
079:             * Publishes (broadcasts) an event based on a library-specific prefix and
080:             * event name.
081:             * @param prefix The prefix that corresponds to this event. This must be a
082:             * prefix that has been registered via OpenAjax.registerLibrary().
083:             * @param name The name of the event to listen for. Names can be any string
084:             * @param publisherData An arbitrary Object holding extra information that
085:             * will be passed as an argument to the handler function. Can be null.
086:             */
087:            public void publish(String prefix, String name, Object publisherData) {
088:                addFunctionCall("OpenAjax.publish", prefix, name, publisherData);
089:            }
090:
091:            /**
092:             * Allows registration of interest in named events based on library-specific
093:             * prefix and event name. Global event matching is provided by passing "*"
094:             * in the prefix and/or name arguments. Optional arguments may be specified
095:             * for executing the specified handler function in a provided scope and for
096:             * further filtering events prior to application.
097:             * <p>
098:             * The callback function will receive the following parameters
099:             * (see OpenAjax.publish() for description of publisherData):
100:             * <pre>
101:             * function(prefix, name, subscriberData, publisherData){ ... }
102:             * </pre>
103:             * @param prefix The prefix that corresponds to this library. This is the
104:             * same value that was previously passed to registerLibrary(). Can be "*" to
105:             * match the provided event name across all libraries.
106:             * @param name The name of the event to listen for. Names can be any string.
107:             * Can be "*" to match all events in the specified toolkit (see prefix). If
108:             * both name and prefix specify "*", all events in the system will be routed
109:             * to the registered handler (modulo any filtering provided by filter).
110:             * @param listener The object to deliver messages to
111:             */
112:            public void subscribe(String prefix, String name,
113:                    PublishListener listener) {
114:            }
115:
116:            /**
117:             * Allows registration of interest in named events based on library-specific
118:             * prefix and event name. Global event matching is provided by passing "*"
119:             * in the prefix and/or name arguments. Optional arguments may be specified
120:             * for executing the specified handler function in a provided scope and for
121:             * further filtering events prior to application.
122:             * <p>
123:             * The callback function will receive the following parameters
124:             * (see OpenAjax.publish() for description of publisherData):
125:             * <pre>
126:             * function(prefix, name, subscriberData, publisherData){ ... }
127:             * </pre>
128:             * @param prefix The prefix that corresponds to this library. This is the
129:             * same value that was previously passed to registerLibrary(). Can be "*" to
130:             * match the provided event name across all libraries.
131:             * @param name The name of the event to listen for. Names can be any string.
132:             * Can be "*" to match all events in the specified toolkit (see prefix). If
133:             * both name and prefix specify "*", all events in the system will be routed
134:             * to the registered handler (modulo any filtering provided by filter).
135:             * @param listener The object to deliver messages to
136:             */
137:            public void subscribe(String prefix, String name,
138:                    PublishListener listener, Object subscriberData) {
139:            }
140:
141:            /**
142:             * Removes a subscription to an event. In order for a subscription to be
143:             * removed, the values of the parameters supplied to OpenAjax.unsubscribe()
144:             * must exactly match the values of the parameters supplied to a previous
145:             * call to OpenAjax.subscribe(). Note that it is possible that one
146:             * invocation of OpenAjax.unsubscribe() might result in removal of multiple
147:             * subscriptions.
148:             * @param prefix The prefix that corresponds to this library. This is the
149:             * same value that was previously passed to registerLibrary(). Can be "*" to
150:             * match the provided event name across all libraries.
151:             * @param name The name of the event to listen for. Names can be any string.
152:             * Can be "*" to match all events in the specified toolkit (see prefix). If
153:             * both name and prefix specify "*", all events in the system will be routed
154:             * to the registered handler (modulo any filtering provided by filter).
155:             * @param listener The object to deliver messages to
156:             */
157:            public void unsubscribe(String prefix, String name,
158:                    PublishListener listener) {
159:            }
160:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.