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


001:        //========================================================================
002:        //$Id: Connector.java,v 1.7 2005/11/25 21:01:45 gregwilkins 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.jetty;
017:
018:        import java.io.IOException;
019:
020:        import org.mortbay.component.LifeCycle;
021:        import org.mortbay.io.Buffers;
022:        import org.mortbay.io.EndPoint;
023:        import org.mortbay.util.ajax.Continuation;
024:
025:        /** HTTP Connector.
026:         * Implementations of this interface provide connectors for the HTTP protocol.
027:         * A connector receives requests (normally from a socket) and calls the 
028:         * handle method of the Handler object.  These operations are performed using
029:         * threads from the ThreadPool set on the connector.
030:         * 
031:         * When a connector is registered with an instance of Server, then the server
032:         * will set itself as both the ThreadPool and the Handler.  Note that a connector
033:         * can be used without a Server if a thread pool and handler are directly provided.
034:         * 
035:         * @author gregw
036:         * 
037:         */
038:        public interface Connector extends LifeCycle, Buffers {
039:            /* ------------------------------------------------------------ */
040:            /**
041:             * @return the name of the connector. Defaults to the HostName:port
042:             */
043:            String getName();
044:
045:            /* ------------------------------------------------------------ */
046:            /**
047:             * Opens the connector 
048:             * @throws IOException
049:             */
050:            void open() throws IOException;
051:
052:            void close() throws IOException;
053:
054:            void setServer(Server server);
055:
056:            Server getServer();
057:
058:            /* ------------------------------------------------------------ */
059:            /**
060:             * @return Returns the headerBufferSize.
061:             */
062:            int getHeaderBufferSize();
063:
064:            /* ------------------------------------------------------------ */
065:            /**
066:             * Set the size of the buffer to be used for request and response headers.
067:             * An idle connection will at most have one buffer of this size allocated.
068:             * @param headerBufferSize The headerBufferSize to set.
069:             */
070:            void setHeaderBufferSize(int headerBufferSize);
071:
072:            /* ------------------------------------------------------------ */
073:            /**
074:             * @return Returns the requestBufferSize.
075:             */
076:            int getRequestBufferSize();
077:
078:            /* ------------------------------------------------------------ */
079:            /**
080:             * Set the size of the content buffer for receiving requests. 
081:             * These buffers are only used for active connections that have
082:             * requests with bodies that will not fit within the header buffer.
083:             * @param requestBufferSize The requestBufferSize to set.
084:             */
085:            void setRequestBufferSize(int requestBufferSize);
086:
087:            /* ------------------------------------------------------------ */
088:            /**
089:             * @return Returns the responseBufferSize.
090:             */
091:            int getResponseBufferSize();
092:
093:            /* ------------------------------------------------------------ */
094:            /**
095:             * Set the size of the content buffer for sending responses. 
096:             * These buffers are only used for active connections that are sending 
097:             * responses with bodies that will not fit within the header buffer.
098:             * @param responseBufferSize The responseBufferSize to set.
099:             */
100:            void setResponseBufferSize(int responseBufferSize);
101:
102:            /* ------------------------------------------------------------ */
103:            int getIntegralPort();
104:
105:            String getIntegralScheme();
106:
107:            boolean isIntegral(Request request);
108:
109:            /* ------------------------------------------------------------ */
110:            int getConfidentialPort();
111:
112:            String getConfidentialScheme();
113:
114:            boolean isConfidential(Request request);
115:
116:            /* ------------------------------------------------------------ */
117:            /** Customize a request for an endpoint.
118:             * Called on every request to allow customization of the request for
119:             * the particular endpoint (eg security properties from a SSL connection).
120:             * @param endpoint
121:             * @param request
122:             * @throws IOException
123:             */
124:            void customize(EndPoint endpoint, Request request)
125:                    throws IOException;
126:
127:            /* ------------------------------------------------------------ */
128:            /** Persist an endpoint.
129:             * Called after every request if the connection is to remain open.
130:             * @param endpoint
131:             * @param request
132:             * @throws IOException
133:             */
134:            void persist(EndPoint endpoint) throws IOException;
135:
136:            Continuation newContinuation();
137:
138:            String getHost();
139:
140:            void setHost(String hostname);
141:
142:            /* ------------------------------------------------------------ */
143:            /**
144:             * @param port The port fto listen of for connections or 0 if any available
145:             * port may be used.
146:             */
147:            void setPort(int port);
148:
149:            /* ------------------------------------------------------------ */
150:            /**
151:             * @return The configured port for the connector or 0 if any available
152:             * port may be used.
153:             */
154:            int getPort();
155:
156:            /* ------------------------------------------------------------ */
157:            /**
158:             * @return The actual port the connector is listening on or -1 if there 
159:             * is no port or the connector is not open.
160:             */
161:            int getLocalPort();
162:
163:            /* ------------------------------------------------------------ */
164:            int getMaxIdleTime();
165:
166:            void setMaxIdleTime(int ms);
167:
168:            /* ------------------------------------------------------------ */
169:            int getLowResourceMaxIdleTime();
170:
171:            void setLowResourceMaxIdleTime(int ms);
172:
173:            /* ------------------------------------------------------------ */
174:            /**
175:             * @return the underlying socket, channel, buffer etc. for the connector.
176:             */
177:            Object getConnection();
178:
179:            /* ------------------------------------------------------------ */
180:            /**
181:             * @return true if names resolution should be done.
182:             */
183:            boolean getResolveNames();
184:
185:            /* ------------------------------------------------------------ */
186:            /**
187:             * @return Get the number of requests handled by this connector
188:             * since last call of statsReset(). If setStatsOn(false) then this
189:             * is undefined.
190:             */
191:            public int getRequests();
192:
193:            /* ------------------------------------------------------------ */
194:            /**
195:             * @return Returns the connectionsDurationMin.
196:             */
197:            public long getConnectionsDurationMin();
198:
199:            /* ------------------------------------------------------------ */
200:            /**
201:             * @return Returns the connectionsDurationTotal.
202:             */
203:            public long getConnectionsDurationTotal();
204:
205:            /* ------------------------------------------------------------ */
206:            /**
207:             * @return Returns the connectionsOpenMin.
208:             */
209:            public int getConnectionsOpenMin();
210:
211:            /* ------------------------------------------------------------ */
212:            /**
213:             * @return Returns the connectionsRequestsMin.
214:             */
215:            public int getConnectionsRequestsMin();
216:
217:            /* ------------------------------------------------------------ */
218:            /** 
219:             * @return Number of connections accepted by the server since
220:             * statsReset() called. Undefined if setStatsOn(false).
221:             */
222:            public int getConnections();
223:
224:            /* ------------------------------------------------------------ */
225:            /** 
226:             * @return Number of connections currently open that were opened
227:             * since statsReset() called. Undefined if setStatsOn(false).
228:             */
229:            public int getConnectionsOpen();
230:
231:            /* ------------------------------------------------------------ */
232:            /** 
233:             * @return Maximum number of connections opened simultaneously
234:             * since statsReset() called. Undefined if setStatsOn(false).
235:             */
236:            public int getConnectionsOpenMax();
237:
238:            /* ------------------------------------------------------------ */
239:            /** 
240:             * @return Average duration in milliseconds of open connections
241:             * since statsReset() called. Undefined if setStatsOn(false).
242:             */
243:            public long getConnectionsDurationAve();
244:
245:            /* ------------------------------------------------------------ */
246:            /** 
247:             * @return Maximum duration in milliseconds of an open connection
248:             * since statsReset() called. Undefined if setStatsOn(false).
249:             */
250:            public long getConnectionsDurationMax();
251:
252:            /* ------------------------------------------------------------ */
253:            /** 
254:             * @return Average number of requests per connection
255:             * since statsReset() called. Undefined if setStatsOn(false).
256:             */
257:            public int getConnectionsRequestsAve();
258:
259:            /* ------------------------------------------------------------ */
260:            /** 
261:             * @return Maximum number of requests per connection
262:             * since statsReset() called. Undefined if setStatsOn(false).
263:             */
264:            public int getConnectionsRequestsMax();
265:
266:            /* ------------------------------------------------------------ */
267:            /** Reset statistics.
268:             */
269:            public void statsReset();
270:
271:            /* ------------------------------------------------------------ */
272:            public void setStatsOn(boolean on);
273:
274:            /* ------------------------------------------------------------ */
275:            /** 
276:             * @return True if statistics collection is turned on.
277:             */
278:            public boolean getStatsOn();
279:
280:            /* ------------------------------------------------------------ */
281:            /** 
282:             * @return Timestamp stats were started at.
283:             */
284:            public long getStatsOnMs();
285:
286:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.