Source Code Cross Referenced for CometEvent.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » catalina » 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 » Sevlet Container » apache tomcat 6.0.14 » org.apache.catalina 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:
018:        package org.apache.catalina;
019:
020:        import java.io.IOException;
021:
022:        import javax.servlet.ServletException;
023:        import javax.servlet.http.HttpServletRequest;
024:        import javax.servlet.http.HttpServletResponse;
025:
026:        /**
027:         * The CometEvent interface.
028:         * 
029:         * @author Filip Hanik
030:         * @author Remy Maucherat
031:         */
032:        public interface CometEvent {
033:
034:            /**
035:             * Enumeration describing the major events that the container can invoke 
036:             * the CometProcessors event() method with
037:             * BEGIN - will be called at the beginning 
038:             *  of the processing of the connection. It can be used to initialize any relevant 
039:             *  fields using the request and response objects. Between the end of the processing 
040:             *  of this event, and the beginning of the processing of the end or error events,
041:             *  it is possible to use the response object to write data on the open connection.
042:             *  Note that the response object and depedent OutputStream and Writer are still 
043:             *  not synchronized, so when they are accessed by multiple threads, 
044:             *  synchronization is mandatory. After processing the initial event, the request 
045:             *  is considered to be committed.
046:             * READ - This indicates that input data is available, and that one read can be made
047:             *  without blocking. The available and ready methods of the InputStream or
048:             *  Reader may be used to determine if there is a risk of blocking: the servlet
049:             *  should read while data is reported available. When encountering a read error, 
050:             *  the servlet should report it by propagating the exception properly. Throwing 
051:             *  an exception will cause the error event to be invoked, and the connection 
052:             *  will be closed. 
053:             *  Alternately, it is also possible to catch any exception, perform clean up
054:             *  on any data structure the servlet may be using, and using the close method
055:             *  of the event. It is not allowed to attempt reading data from the request 
056:             *  object outside of the execution of this method.
057:             * END - End may be called to end the processing of the request. Fields that have
058:             *  been initialized in the begin method should be reset. After this event has
059:             *  been processed, the request and response objects, as well as all their dependent
060:             *  objects will be recycled and used to process other requests. End will also be 
061:             *  called when data is available and the end of file is reached on the request input
062:             *  (this usually indicates the client has pipelined a request).
063:             * ERROR - Error will be called by the container in the case where an IO exception
064:             *  or a similar unrecoverable error occurs on the connection. Fields that have
065:             *  been initialized in the begin method should be reset. After this event has
066:             *  been processed, the request and response objects, as well as all their dependent
067:             *  objects will be recycled and used to process other requests.
068:             */
069:            public enum EventType {
070:                BEGIN, READ, END, ERROR
071:            }
072:
073:            /**
074:             * Event details
075:             * TIMEOUT - the connection timed out (sub type of ERROR); note that this ERROR type is not fatal, and
076:             *   the connection will not be closed unless the servlet uses the close method of the event
077:             * CLIENT_DISCONNECT - the client connection was closed (sub type of ERROR)
078:             * IOEXCEPTION - an IO exception occurred, such as invalid content, for example, an invalid chunk block (sub type of ERROR)
079:             * WEBAPP_RELOAD - the webapplication is being reloaded (sub type of END)
080:             * SERVER_SHUTDOWN - the server is shutting down (sub type of END)
081:             * SESSION_END - the servlet ended the session (sub type of END)
082:             */
083:            public enum EventSubType {
084:                TIMEOUT, CLIENT_DISCONNECT, IOEXCEPTION, WEBAPP_RELOAD, SERVER_SHUTDOWN, SESSION_END
085:            }
086:
087:            /**
088:             * Returns the HttpServletRequest.
089:             * 
090:             * @return HttpServletRequest
091:             */
092:            public HttpServletRequest getHttpServletRequest();
093:
094:            /**
095:             * Returns the HttpServletResponse.
096:             * 
097:             * @return HttpServletResponse
098:             */
099:            public HttpServletResponse getHttpServletResponse();
100:
101:            /**
102:             * Returns the event type.
103:             * 
104:             * @return EventType
105:             */
106:            public EventType getEventType();
107:
108:            /**
109:             * Returns the sub type of this event.
110:             * 
111:             * @return EventSubType
112:             */
113:            public EventSubType getEventSubType();
114:
115:            /**
116:             * Ends the Comet session. This signals to the container that 
117:             * the container wants to end the comet session. This will send back to the
118:             * client a notice that the server has no more data to send as part of this
119:             * request. The servlet should perform any needed cleanup as if it had recieved
120:             * an END or ERROR event. 
121:             * 
122:             * @throws IOException if an IO exception occurs
123:             */
124:            public void close() throws IOException;
125:
126:            /**
127:             * Sets the timeout for this Comet connection. Please NOTE, that the implementation 
128:             * of a per connection timeout is OPTIONAL and MAY NOT be implemented.<br/>
129:             * This method sets the timeout in milliseconds of idle time on the connection.
130:             * The timeout is reset every time data is received from the connection or data is flushed
131:             * using <code>response.flushBuffer()</code>. If a timeout occurs, the 
132:             * <code>error(HttpServletRequest, HttpServletResponse)</code> method is invoked. The 
133:             * web application SHOULD NOT attempt to reuse the request and response objects after a timeout
134:             * as the <code>error(HttpServletRequest, HttpServletResponse)</code> method indicates.<br/>
135:             * This method should not be called asynchronously, as that will have no effect.
136:             * 
137:             * @param timeout The timeout in milliseconds for this connection, must be a positive value, larger than 0
138:             * @throws IOException An IOException may be thrown to indicate an IO error, 
139:             *         or that the EOF has been reached on the connection
140:             * @throws ServletException An exception has occurred, as specified by the root
141:             *         cause
142:             * @throws UnsupportedOperationException if per connection timeout is not supported, either at all or at this phase
143:             *         of the invocation.
144:             */
145:            public void setTimeout(int timeout) throws IOException,
146:                    ServletException, UnsupportedOperationException;
147:
148:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.