Java Doc for HttpBasicConnection.java in  » Web-Server » Jigsaw » org » w3c » www » protocol » 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 » Jigsaw » org.w3c.www.protocol.http 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.w3c.www.protocol.http.HttpConnection
      org.w3c.www.protocol.http.HttpBasicConnection

HttpBasicConnection
class HttpBasicConnection extends HttpConnection implements HttpStreamObserver(Code)


Field Summary
protected  booleancloseOnEOF
    
 intconnect_timeout
    
protected  intid
     All connections are associated with a uniq identifier, for debugging.
 InetAddressinetaddr
     The target INET address of this connection.
 InputStreaminput
     The socket input stream when available.
protected  Threadold_th
    
 OutputStreamoutput
     THe socket output stream, when available.
 MimeParserparser
     The MIME parser to read input from the connection.
 intport
     The target port number for this connection.
 MimeParserFactoryreply_factory
     The MimeParser factory to use to create Reply instances.
static  Methodsock_m
    
 Threadth
     The thread that owns the connection, for checking assertions.
 inttimeout
    

Constructor Summary
 HttpBasicConnection(HttpServer server, int id, InetAddress addr, int port, int timeout, MimeParserFactory reply_factory)
     Create a new connection.
 HttpBasicConnection(HttpServer server, int id, InetAddress addr, int port, int timeout, int connect_timeout, MimeParserFactory reply_factory)
     Create a new connection.

Method Summary
public synchronized  voidclose()
     Close this connection to terminate it.
protected synchronized  voiddetach()
     Used only when we can't evaluate the end of the connection.
public  voidfinalize()
    
public  OutputStreamgetOutputStream()
     Get the connection output stream.
public  MimeParsergetParser()
     Get the MIME parser to read from this connection.
public  voidmarkIdle(boolean close)
     The connection is now idle again. Mark the connection as idle, and register it to the server's list of idle connection (if this connection can be reused).
public  booleanmarkUsed()
     Mark this connection as being used. The server, which keeps track of idle connections, has decided to use this connection to run some request.
protected  booleanmayReuse()
    
public synchronized  voidnotifyClose(InputStream in)
     The entity stream we observe has been closed.
public synchronized  voidnotifyEOF(InputStream in)
     The entity stream we observe has reached its end.
public synchronized  voidnotifyFailure(InputStream in)
     The entity stream we were to observe refuse to be observed.
public  voidnotifyInputAvailable(InputStream in)
     Some data available on input, while writing to the server.
protected synchronized  voidsetCloseOnEOF(boolean doit)
    
public  StringtoString()
     Print this connection into a String.

Field Detail
closeOnEOF
protected boolean closeOnEOF(Code)
if a close is needed at the end of the connection (ie: on a Connection: close client or server side



connect_timeout
int connect_timeout(Code)
The Connection timeout for the underlying socket



id
protected int id(Code)
All connections are associated with a uniq identifier, for debugging.



inetaddr
InetAddress inetaddr(Code)
The target INET address of this connection.



input
InputStream input(Code)
The socket input stream when available.



old_th
protected Thread old_th(Code)
Old thread (same thread will try to reuse the same connection)



output
OutputStream output(Code)
THe socket output stream, when available.



parser
MimeParser parser(Code)
The MIME parser to read input from the connection.



port
int port(Code)
The target port number for this connection.



reply_factory
MimeParserFactory reply_factory(Code)
The MimeParser factory to use to create Reply instances.



sock_m
static Method sock_m(Code)



th
Thread th(Code)
The thread that owns the connection, for checking assertions.



timeout
int timeout(Code)
The Timout on the underlying socket




Constructor Detail
HttpBasicConnection
HttpBasicConnection(HttpServer server, int id, InetAddress addr, int port, int timeout, MimeParserFactory reply_factory) throws IOException(Code)
Create a new connection. To be used only by HttpServer instances.



HttpBasicConnection
HttpBasicConnection(HttpServer server, int id, InetAddress addr, int port, int timeout, int connect_timeout, MimeParserFactory reply_factory) throws IOException(Code)
Create a new connection. To be used only by HttpServer instances.




Method Detail
close
public synchronized void close()(Code)
Close this connection to terminate it. This method will only close the streams, and free all the data structures that it keeps.



detach
protected synchronized void detach()(Code)
Used only when we can't evaluate the end of the connection. In that case, we are just unregistering it, and wait for the GC to clean the mess afterwards. This method will not close the stream, but will free all the data structures that it keeps to help the GC.



finalize
public void finalize()(Code)



getOutputStream
public OutputStream getOutputStream()(Code)
Get the connection output stream. The output stream to send data on this connection.
exception:
  RuntimeException - If the connection was not previously opened.



getParser
public MimeParser getParser()(Code)
Get the MIME parser to read from this connection. All access to the connection's input stream should go through the MIME parser to ensure buffering coherency. A MimeParser instance suitable to parse the reply input stream.
exception:
  RuntimeException - If the connection was not connected.



markIdle
public void markIdle(boolean close)(Code)
The connection is now idle again. Mark the connection as idle, and register it to the server's list of idle connection (if this connection can be reused). If the connection cannot be reused, detach it from the server and forget about it (the caller will close it by closing the entity stream).
Parameters:
  close - Should this connection be physically closed (it is notreusable), or should we try to keep track of it for later reuse.
exception:
  RuntimeException - If the connection is in an invalid state.



markUsed
public boolean markUsed()(Code)
Mark this connection as being used. The server, which keeps track of idle connections, has decided to use this connection to run some request. Mark this connection as used and unregister it from the server's list of idle connections.

Some assumptions are checked before handing out the connection for use, which can throw an RuntimeException. A boolean, true if the connection can be usedor reused, false otherwise (the connection was detectedidle, and destroy itself).
exception:
  RuntimeException - If the connection is in an invalid state.




mayReuse
protected boolean mayReuse()(Code)
Can this connection be reused as a first choice when requested? This is only a hint, as if all connections fail, the first one will be forced by default a boolean, true by default



notifyClose
public synchronized void notifyClose(InputStream in)(Code)
The entity stream we observe has been closed. After making sure the entire entity has been read, we can safely hand out the connection to the server, for later reuse.
Parameters:
  in - The stream that has been closed.



notifyEOF
public synchronized void notifyEOF(InputStream in)(Code)
The entity stream we observe has reached its end. Notify the server that it can now reuse the connection safely for some other pending requests.
Parameters:
  in - The stream that has reached its end of file.



notifyFailure
public synchronized void notifyFailure(InputStream in)(Code)
The entity stream we were to observe refuse to be observed. The connection will not be reusable, so we should detach it from the managing server, without closing it, since the entity reader will close it itself.
Parameters:
  in - The stream that has been closed.



notifyInputAvailable
public void notifyInputAvailable(InputStream in)(Code)
Some data available on input, while writing to the server. This callback gets called when the client is emitting data to the server and the server has sent us something before we actually sent all our bytes.

Take any appropriate action.




setCloseOnEOF
protected synchronized void setCloseOnEOF(boolean doit)(Code)



toString
public String toString()(Code)
Print this connection into a String. A String containing the external representation for the connection.



Fields inherited from org.w3c.www.protocol.http.HttpConnection
protected boolean cached(Code)(Java Doc)
protected LRUAble lru_next(Code)(Java Doc)
protected LRUAble lru_prev(Code)(Java Doc)
protected HttpServer server(Code)(Java Doc)

Methods inherited from org.w3c.www.protocol.http.HttpConnection
abstract public void close()(Code)(Java Doc)
public LRUAble getNext()(Code)(Java Doc)
public LRUAble getPrev()(Code)(Java Doc)
final protected HttpServer getServer()(Code)(Java Doc)
protected boolean mayReuse()(Code)(Java Doc)
public void setNext(LRUAble next)(Code)(Java Doc)
public void setPrev(LRUAble prev)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.