Source Code Cross Referenced for HttpConnectionPool.java in  » Web-Crawler » JoBo » net » matuschek » http » connection » 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 » Web Crawler » JoBo » net.matuschek.http.connection 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        package net.matuschek.http.connection;
02:
03:        /*********************************************
04:         Copyright (c) 2001 by Daniel Matuschek
05:         *********************************************/
06:
07:        import java.io.IOException;
08:        import java.net.InetAddress;
09:
10:        /**
11:         * This class implements an connection pool for HTTP TCP connections.
12:         * Actually, it doesn't pool, but this will be implemented in the next
13:         * time.
14:         * 
15:         * @author Daniel Matuschek 
16:         * @version $Id: HttpConnectionPool.java,v 1.4 2001/04/20 16:12:42 matuschd Exp $
17:         */
18:        public abstract class HttpConnectionPool {
19:
20:            /** default timeout in milliseconds (60 seconds) */
21:            private static int DEFAULT_TIMEOUT = 60000;
22:
23:            /** the HttpConnections */
24:            HttpConnection connections[];
25:
26:            /** TCP socket timeout (for connect and read/write) */
27:            int connectionTimeout = DEFAULT_TIMEOUT;
28:
29:            /**
30:             * Creates a new HTTP connection pool
31:             *
32:             * @param maxConnections maximal number of open connections
33:             */
34:            public HttpConnectionPool(int maxConnections) {
35:                connections = new HttpConnection[maxConnections];
36:            }
37:
38:            /**
39:             * Sets the timeout for the HTTP connections
40:             * @param connectionTimeout timeout in milliseconds
41:             */
42:            public void setConnectionTimeout(int connectionTimeout) {
43:                this .connectionTimeout = connectionTimeout;
44:            }
45:
46:            /**
47:             * Gets the timeout for the HTTP connections
48:             * @return timeout in milliseconds
49:             */
50:            public int getConnectionTimeout() {
51:                return this .connectionTimeout;
52:            }
53:
54:            /**
55:             * Gets a connection to the given server and port. Opens a new
56:             * connection or uses a connection from the pool if there is one
57:             * for this address/port combination
58:             *
59:             * @param address the IP address to connect to
60:             * @param port the port to connect to (usually 80 for HTTP)
61:             * @return a HttpConnection object 
62:             * @exception IOException if the TCP socket connection could
63:             * not be established or all slots are used
64:             */
65:            public abstract HttpConnection getConnection(InetAddress addr,
66:                    int port) throws IOException;
67:
68:            /**
69:             * Gives back the given HttpConnection to the pool
70:             */
71:            public abstract void giveback(HttpConnection conn);
72:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.