Hello. Would you please explain me or point to a guide how to use an advantage of NIO with Restlet. I have digged the following information only.
If we ‘re going to use an NIO processing of the web client request/response we need to use: 1) the Reactor pattern, mainly to deal with the great number of connections ( so using Readiness selection, the transformation of connection/request to event and placing event in a queue, using a high-performance bounded thread pool to transmit an event to user-level code to process). This part could be named as asynchronized topic of NIO Web Server. 2) the non-blocking IO, just to not suspend any thread from thread pool if an blocking of processing occurs while an read/write to client socket. The both features need to be realized by front-end server. Restlet is the framework that placed behind it, so it needs to provide 1) a special thread pools / resources pool to efficiently works with user-level code processing an request / response event queue. 2) may be an extension to expose an underlying server API if one would use some special direct tricks / features. 3) a set of function that could be worked in non blocking manner with underlying non blocking server api. We’re free use Restlet either standalone (direct call to org.restlet.Component#start()), or in Servlet Container. You’re proposing the following connectors: 1) AsyncWeb (based on MINA general nio server) 2) Jetty (own development of nio) 3) Simple 4) Grizzly (java5ee nio http server implementation and there exists an prototype of grizzly front-ending of jetty) 5) Plan to work with custom reimplementation of MINA-based nio http server, more integrated with the restlet than what you have got with AsyncWeb one, right? So the actual ext connectors propose for end-users 1) ability to exploit Reactor pattern realized by these servers. 2) hook to the concrete implementation server API. Am I right that you share some resources (pools) with the underlied server resources? If yes, then concrete ext-connectors serve this performance issue as well. The concrete non blocking support is given with the help of 2 methods (read from ReadableByteChannel, write to WritableByteCHannel) of org.restlet.data.Representation class. So if we’re going to use an NIO advantage we need to switch on an Reactor support from the server (HttpServerHelper type = 1), and use the above methods to transfer information in both side. Do we need to care on smth else on the restler level? What does the class JettyCall stand for? What do we actually need to do to start application with nio support? Just having an restlet, noelios, ext deployed with appl as servlet to container? Doesn’t the working in servlet container break an NIO support? Is it possible to start the restlet in standalone mode with nio support? What’s the preferable way standalone or container-based ( means, if the standalone is allowed, could we expect that standalone mode would propose an little servlet functionality so show greater performance) Thanks and sorry for the lack of knowledge in area.

