I would like to use Shiro with an asynchronous, NIO-based server (JBoss Netty). Because this server is based on NIO, it does not use the single thread per request model (one selecting thread can be used to service multiple requests, or "Channels" in Netty terms). As such, we cannot assume that any thread is servicing only a single client.
I would like to associate a Shiro "Subject" with each Netty "Channel"; does anyone have any advice on how to do this successfully? The best thing I have been able to come up with (although I have not tested it) is building Subject instances manually whenever a new Channel is initiated and then looking up the Subject in whatever thread is executing via the sessionId (which gets sent initially to the client and then received by the server with every request). The application is not a web application (uses persistent socket connections instead of HTTP) if that matters. Thanks, David
