Source Code Cross Referenced for HttpSocketPool.java in  » Web-Server » Brazil » sunlabs » brazil » util » http » 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 Server » Brazil » sunlabs.brazil.util.http 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * HttpSocketPool.java
003:         *
004:         * Brazil project web application Framework,
005:         * export version: 1.1 
006:         * Copyright (c) 1999 Sun Microsystems, Inc.
007:         *
008:         * Sun Public License Notice
009:         *
010:         * The contents of this file are subject to the Sun Public License Version 
011:         * 1.0 (the "License"). You may not use this file except in compliance with 
012:         * the License. A copy of the License is included as the file "license.terms",
013:         * and also available at http://www.sun.com/
014:         * 
015:         * The Original Code is from:
016:         *    Brazil project web application Framework release 1.1.
017:         * The Initial Developer of the Original Code is: cstevens.
018:         * Portions created by cstevens are Copyright (C) Sun Microsystems, Inc.
019:         * All Rights Reserved.
020:         * 
021:         * Contributor(s): cstevens, suhler.
022:         *
023:         * Version:  1.6
024:         * Created by cstevens on 99/09/15
025:         * Last modified by cstevens on 99/10/14 13:23:44
026:         */
027:
028:        package sunlabs.brazil.util.http;
029:
030:        import java.io.IOException;
031:
032:        /**
033:         * This interface represents a cache of idle sockets.  Once a request has
034:         * been handled, the now-idle socket can be remembered and reused later in
035:         * case another HTTP request is made to the same remote host.  Currently, the
036:         * only instance of this interface is used by the <code>HttpRequest</code>
037:         * class.
038:         * 
039:         * @author      Colin Stevens (colin.stevens@sun.com)
040:         * @version	1.6 99/10/14
041:         */
042:        public interface HttpSocketPool {
043:            /**
044:             * Returns an <code>HttpSocket</code> that can be used to communicate
045:             * with the specified port on the named host.
046:             * <p>
047:             * It is this method's responsibility to to fill in all the public
048:             * member variables of the <code>HttpSocket</code> before returning.
049:             * <p>
050:             * For each call to this method, there should eventually be a call to
051:             * <code>close</code> when the <code>HttpSocket</code> isn't needed
052:             * anymore.
053:             *
054:             * @param	host
055:             *		The host name.
056:             *
057:             * @param	port
058:             *		The port number.
059:             *
060:             * @param	reuse
061:             *		<code>true</code> to request that this pool attempt to find
062:             *		and reuse an existing idle connection, <code>false</code>
063:             *		to request that this pool establish a new connection to
064:             *		the named host.
065:             *
066:             * @return	The <code>HttpSocket</code>.
067:             *		
068:             * @throws	IOException
069:             *		if there is a problem connecting to the specified port on
070:             *		the named host.  The <code>IOException</code>s (and 
071:             *		subclasses) that might be thrown depend upon how the
072:             *		socket connection is established.  See the socket
073:             *		documentation for further details.  Some subclasses that
074:             *		might be thrown are as follows:
075:             *
076:             * @throws	java.io.UnknownHostException
077:             *		if the host name cannot be resolved.
078:             *
079:             * @throws	java.io.ConnectionException
080:             *		if the named host is not listening on the specified port.
081:             *
082:             * @throws	java.io.InterruptedIOException
083:             *		if the connection times out or this thread is interrupted by
084:             *		<code>Thread.interrupt</code>.
085:             */
086:            public HttpSocket get(String host, int port, boolean reuse)
087:                    throws IOException;
088:
089:            /**
090:             * Releases an <code>HttpSocket</code> to this pool when it is not
091:             * in use any more.
092:             * <p>
093:             * It is this method's responsibility to release resources used
094:             * by the <code>HttpSocket</code>, such as closing the underlying socket.
095:             * <p>
096:             * After calling this method, the user should not refer to the specified
097:             * <code>HttpSocket</code> any more.
098:             *
099:             * @param	hs
100:             *		The <code>HttpSocket</code> to release.
101:             *
102:             * @param	reuse
103:             *		<code>true</code> if the specified <code>HttpSocket</code>
104:             *		should be put back into the idle pool, <code>false</code>
105:             *		if it should be released immediately.
106:             */
107:            public void close(HttpSocket hs, boolean reuse);
108:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.