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


org.mortbay.jetty.nio.AbstractNIOConnector
   org.mortbay.jetty.nio.SelectChannelConnector

SelectChannelConnector
public class SelectChannelConnector extends AbstractNIOConnector (Code)
Selecting NIO connector.

This connector uses efficient NIO buffers with a non blocking threading model. Direct NIO buffers are used and threads are only allocated to connections with requests. Synchronization is used to simulate blocking for the servlet API, and any unflushed content at the end of request handling is written asynchronously.

This connector is best used when there are a many connections that have idle periods.

When used with org.mortbay.util.ajax.Continuation , threadless waits are supported. When a filter or servlet calls getEvent on a Continuation, a org.mortbay.jetty.RetryRequest runtime exception is thrown to allow the thread to exit the current request handling. Jetty will catch this exception and will not send a response to the client. Instead the thread is released and the Continuation is placed on the timer queue. If the Continuation timeout expires, or it's resume method is called, then the request is again allocated a thread and the request is retried. The limitation of this approach is that request content is not available on the retried request, thus if possible it should be read after the continuation or saved as a request attribute or as the associated object of the Continuation instance.


author:
   gregw

Inner Class :public static class ConnectorEndPoint extends SelectChannelEndPoint
Inner Class :public static class RetryContinuation extends Timeout.Task implements Continuation,Runnable


Constructor Summary
public  SelectChannelConnector()
     Constructor.

Method Summary
public  voidaccept(int acceptorID)
    
public  voidclose()
    
public  voidcustomize(org.mortbay.io.EndPoint endpoint, Request request)
    
protected  voiddoStart()
    
protected  voiddoStop()
    
public  ObjectgetConnection()
    
public  booleangetDelaySelectKeyUpdate()
     Get delay select key update If true, the select set is not updated when a endpoint is dispatched for reading.
public  intgetLocalPort()
    
public  ContinuationnewContinuation()
    
protected  SelectChannelEndPointnewEndPoint(SocketChannel channel, SelectSet selectSet, SelectionKey key)
    
public  voidopen()
    
public  voidpersist(org.mortbay.io.EndPoint endpoint)
    
public  voidsetDelaySelectKeyUpdate(boolean delay)
    
Parameters:
  delay - If true, updating a SelectionKey is delayed until a redundant event is schedules.
public  voidsetMaxIdleTime(int maxIdleTime)
    
public  voidstopAccept(int acceptorID)
    


Constructor Detail
SelectChannelConnector
public SelectChannelConnector()(Code)
Constructor.




Method Detail
accept
public void accept(int acceptorID) throws IOException(Code)



close
public void close() throws IOException(Code)



customize
public void customize(org.mortbay.io.EndPoint endpoint, Request request) throws IOException(Code)



doStart
protected void doStart() throws Exception(Code)



doStop
protected void doStop() throws Exception(Code)



getConnection
public Object getConnection()(Code)



getDelaySelectKeyUpdate
public boolean getDelaySelectKeyUpdate()(Code)
Get delay select key update If true, the select set is not updated when a endpoint is dispatched for reading. The assumption is that the task will be short and thus will probably be complete before the select is tried again. Returns the assumeShortDispatch.



getLocalPort
public int getLocalPort()(Code)



newContinuation
public Continuation newContinuation()(Code)



newEndPoint
protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectSet selectSet, SelectionKey key) throws IOException(Code)



open
public void open() throws IOException(Code)



persist
public void persist(org.mortbay.io.EndPoint endpoint) throws IOException(Code)



setDelaySelectKeyUpdate
public void setDelaySelectKeyUpdate(boolean delay)(Code)

Parameters:
  delay - If true, updating a SelectionKey is delayed until a redundant event is schedules. This is an optimization that assumes event handling can be completed before the next selectcompletes.



setMaxIdleTime
public void setMaxIdleTime(int maxIdleTime)(Code)



stopAccept
public void stopAccept(int acceptorID) throws Exception(Code)



Methods inherited from org.mortbay.jetty.nio.AbstractNIOConnector
public boolean getUseDirectBuffers()(Code)(Java Doc)
protected Buffer newBuffer(int size)(Code)(Java Doc)
public void setUseDirectBuffers(boolean direct)(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.