users@grizzly.java.net

problems with thread locals?

From: Jon Brisbin <jon_at_jbrisbin.com>
Date: Tue, 16 Aug 2011 15:22:07 -0500 (CDT)

Not sure what's going on here, but I have an HTTP server set up using Grizzly's HTTP server abstractions (I'm subclassing HttpHandler). While servicing a request, I'm trying to make an asynchronous REST connection to another service using the HttpClientFilter and a raw TCPNIOTransport, which I configure on demand.

But weird things happen if I have a ByteBufferMemoryManager in my server transport. I get odd ClassCastExceptions when I try and do a "new HttpClientFilter()" while servicing the request that lead me to believe there's some ThreadLocal magic going on that is making this difficult.

Can I create an outbound HTTP connection in Grizzly while servicing an incoming HTTP request from the client using two different transports/filter chains?



Thanks!

Jon Brisbin
http//jbrisbin.com