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


java.lang.Object
   org.w3c.jigsaw.http.RequestTimeout
      org.w3c.jigsaw.http.socket.SocketClient

All known Subclasses:   org.w3c.jigsaw.https.socket.SSLSocketClient,
SocketClient
public class SocketClient extends Client implements Runnable(Code)
This class implements the object that handles client connections. One such object exists per open connections at any given time.

The basic architecture is the following: the httpd instance accepts new connections on its port. When such a connection is accepted a Client object is requested to the client pool (which can implement what ever strategy is suitable). Each request is than managed by looking up an resource and invoking the resource methods corresponding to the request.
See Also:   org.w3c.jigsaw.http.httpd
See Also:   org.w3c.jigsaw.http.Request
See Also:   org.w3c.jigsaw.http.Reply



Field Summary
protected  booleanalive
    
protected  intbindcount
     Number of times this client was bound to a connection.
protected  SocketOutputBufferbufout
     Our reusable output buffer.
protected  booleandone
    
protected  booleanidle
    
protected  Socketsocket
     The socket currently handled by the client.
 SocketClientStatestate
    
protected  Threadthread
     The thread that we have been attached to.

Constructor Summary
protected  SocketClient(httpd server, SocketClientFactory pool, SocketClientState state)
     Create an empty client, that will be ready to work.

Method Summary
protected synchronized  voidbind(Socket socket)
     SocketClientFactory interface - Bind the socket to this client. Binding a socket to a client triggers the processing of the underlying connection.
final public  intgetBindCount()
     Get the total number of times this client was bound to a socket.
public  InetAddressgetInetAddress()
     Client implementation - Get the IP address of this client.
protected  ThreadgetThread()
     Get the thread powering that client.
protected  booleanidleConnection()
     Client implementation - The current connection is idle.
public  voidjoin()
     If this client is allocated a thread, join it.
protected synchronized  voidkill(boolean now)
     SocketClientFactory interface - Kill this client.
public  voidrun()
     Run for our newly attached connection.
protected  voidstopConnection()
     Client implementation - This connection has been stopped.
public  StringtoString()
     Print that client into a String.
protected synchronized  voidunbind()
     SocketClientFactory interface - Unbind this client.
protected  voidusedConnection()
     Client implementation - The current connection is in use.

Field Detail
alive
protected boolean alive(Code)
Is this client still alive ?



bindcount
protected int bindcount(Code)
Number of times this client was bound to a connection.



bufout
protected SocketOutputBuffer bufout(Code)
Our reusable output buffer.



done
protected boolean done(Code)
are we done?



idle
protected boolean idle(Code)
Our we idle (waiting for next request ?)



socket
protected Socket socket(Code)
The socket currently handled by the client.



state
SocketClientState state(Code)
The client state for this client, has managed by the SocketClientFactory
See Also:   SocketClientFactory



thread
protected Thread thread(Code)
The thread that we have been attached to.




Constructor Detail
SocketClient
protected SocketClient(httpd server, SocketClientFactory pool, SocketClientState state)(Code)
Create an empty client, that will be ready to work. The created client will run and wait for it to be bind to some socket before proceeding.
Parameters:
  server - The server to which this client is attached.
Parameters:
  id - The client identifier.
See Also:   org.w3c.jigsaw.http.Client
See Also:   org.w3c.jigsaw.http.ClientFactory




Method Detail
bind
protected synchronized void bind(Socket socket)(Code)
SocketClientFactory interface - Bind the socket to this client. Binding a socket to a client triggers the processing of the underlying connection. It is assumed that the client was ready to handle a new connection before this method was called.
Parameters:
  socket - The socket this client should now handle.



getBindCount
final public int getBindCount()(Code)
Get the total number of times this client was bound to a socket. An integer, indicatingthe number of bind calls on this client.



getInetAddress
public InetAddress getInetAddress()(Code)
Client implementation - Get the IP address of this client. An InetAddress instance, or null if theclient is not currently running.



getThread
protected Thread getThread()(Code)
Get the thread powering that client. A Thread instance, or null.



idleConnection
protected boolean idleConnection()(Code)
Client implementation - The current connection is idle. The client is about to wait for the next request from the net, mark it as idle to make it a candidate for persistent connection closing. A boolean, if true our client factory wantsus to stop right now, in order to handle some other connection.



join
public void join()(Code)
If this client is allocated a thread, join it.



kill
protected synchronized void kill(boolean now)(Code)
SocketClientFactory interface - Kill this client. The clean way for our client factory to shut us down unconditionally. This will free all resources acquired by this client, stop the current connection processing if needed, and terminate the underlying thread.



run
public void run()(Code)
Run for our newly attached connection. A boolean, true if the client is to be killedas decided by its SocketClientFactory creator.



stopConnection
protected void stopConnection()(Code)
Client implementation - This connection has been stopped. Make sure the whole socket is closed, and be ready to handle next connection.



toString
public String toString()(Code)
Print that client into a String. A String instance.



unbind
protected synchronized void unbind()(Code)
SocketClientFactory interface - Unbind this client. This client is handling an idle connection, unbind it to make it free for handling some other more buzy connection.



usedConnection
protected void usedConnection()(Code)
Client implementation - The current connection is in use. A request is about to be processed, mark that connection as used, to remove it from the idle state.




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.