Source Code Cross Referenced for EndPoint.java in  » Sevlet-Container » jetty-modules » org » mortbay » io » 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 » jetty modules » org.mortbay.io 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //========================================================================
002:        //$Id: EndPoint.java,v 1.1 2005/10/05 14:09:25 janb Exp $
003:        //Copyright 2004-2005 Mort Bay Consulting Pty. Ltd.
004:        //------------------------------------------------------------------------
005:        //Licensed under the Apache License, Version 2.0 (the "License");
006:        //you may not use this file except in compliance with the License.
007:        //You may obtain a copy of the License at 
008:        //http://www.apache.org/licenses/LICENSE-2.0
009:        //Unless required by applicable law or agreed to in writing, software
010:        //distributed under the License is distributed on an "AS IS" BASIS,
011:        //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012:        //See the License for the specific language governing permissions and
013:        //limitations under the License.
014:        //========================================================================
015:
016:        package org.mortbay.io;
017:
018:        import java.io.IOException;
019:
020:        /**
021:         * @author gregw
022:         * A transport EndPoint
023:         */
024:        public interface EndPoint {
025:
026:            /**
027:             * Close any backing stream associated with the buffer
028:             */
029:            void close() throws IOException;
030:
031:            /**
032:             * Fill the buffer from the current putIndex to it's capacity from whatever 
033:             * byte source is backing the buffer. The putIndex is increased if bytes filled.
034:             * The buffer may chose to do a compact before filling.
035:             * @return an <code>int</code> value indicating the number of bytes 
036:             * filled or -1 if EOF is reached.
037:             */
038:            int fill(Buffer buffer) throws IOException;
039:
040:            /**
041:             * Flush the buffer from the current getIndex to it's putIndex using whatever byte
042:             * sink is backing the buffer. The getIndex is updated with the number of bytes flushed.
043:             * Any mark set is cleared.
044:             * If the entire contents of the buffer are flushed, then an implicit empty() is done.
045:             * 
046:             * @param buffer The buffer to flush. This buffers getIndex is updated.
047:             * @return  the number of bytes written
048:             */
049:            int flush(Buffer buffer) throws IOException;
050:
051:            /**
052:             * Flush the buffer from the current getIndex to it's putIndex using whatever byte
053:             * sink is backing the buffer. The getIndex is updated with the number of bytes flushed.
054:             * Any mark set is cleared.
055:             * If the entire contents of the buffer are flushed, then an implicit empty() is done.
056:             * The passed header/trailer buffers are written before/after the contents of this buffer. This may be done 
057:             * either as gather writes, as a poke into this buffer or as several writes. The implementation is free to
058:             * select the optimal mechanism.
059:             * @param header A buffer to write before flushing this buffer. This buffers getIndex is updated.
060:             * @param buffer The buffer to flush. This buffers getIndex is updated.
061:             * @param trailer A buffer to write after flushing this buffer. This buffers getIndex is updated.
062:             * @return the total number of bytes written.
063:             */
064:            int flush(Buffer header, Buffer buffer, Buffer trailer)
065:                    throws IOException;
066:
067:            /* ------------------------------------------------------------ */
068:            /**
069:             * @return The local IP address to which this <code>EndPoint</code> is bound, or <code>null</code>
070:             * if this <code>EndPoint</code> does not represent a network connection.
071:             */
072:            public String getLocalAddr();
073:
074:            /* ------------------------------------------------------------ */
075:            /**
076:             * @return The local host name to which this <code>EndPoint</code> is bound, or <code>null</code>
077:             * if this <code>EndPoint</code> does not represent a network connection.
078:             */
079:            public String getLocalHost();
080:
081:            /* ------------------------------------------------------------ */
082:            /**
083:             * @return The local port number on which this <code>EndPoint</code> is listening, or <code>0</code>
084:             * if this <code>EndPoint</code> does not represent a network connection.
085:             */
086:            public int getLocalPort();
087:
088:            /* ------------------------------------------------------------ */
089:            /**
090:             * @return The remote IP address to which this <code>EndPoint</code> is connected, or <code>null</code>
091:             * if this <code>EndPoint</code> does not represent a network connection.
092:             */
093:            public String getRemoteAddr();
094:
095:            /* ------------------------------------------------------------ */
096:            /**
097:             * @return The host name of the remote machine to which this <code>EndPoint</code> is connected, or <code>null</code>
098:             * if this <code>EndPoint</code> does not represent a network connection.
099:             */
100:            public String getRemoteHost();
101:
102:            /* ------------------------------------------------------------ */
103:            /**
104:             * @return The remote port number to which this <code>EndPoint</code> is connected, or <code>0</code>
105:             * if this <code>EndPoint</code> does not represent a network connection.
106:             */
107:            public int getRemotePort();
108:
109:            /* ------------------------------------------------------------ */
110:            public boolean isBlocking();
111:
112:            /* ------------------------------------------------------------ */
113:            public boolean isBufferred();
114:
115:            /* ------------------------------------------------------------ */
116:            public boolean blockReadable(long millisecs) throws IOException;
117:
118:            /* ------------------------------------------------------------ */
119:            public boolean blockWritable(long millisecs) throws IOException;
120:
121:            /* ------------------------------------------------------------ */
122:            public boolean isOpen();
123:
124:            /* ------------------------------------------------------------ */
125:            /**
126:             * @return The underlying transport object (socket, channel, etc.)
127:             */
128:            public Object getTransport();
129:
130:            /* ------------------------------------------------------------ */
131:            /**
132:             * @return True if the endpoint has some buffered input data
133:             */
134:            public boolean isBufferingInput();
135:
136:            /* ------------------------------------------------------------ */
137:            /**
138:             * @return True if the endpoint has some buffered output data
139:             */
140:            public boolean isBufferingOutput();
141:
142:            /* ------------------------------------------------------------ */
143:            /** Flush any buffered output.
144:             * May fail to write all data if endpoint is non-blocking
145:             * @throws IOException 
146:             */
147:            public void flush() throws IOException;
148:
149:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.