I want to do some kind of processing of request/response inside Context. Processing is being done by instance of, let's call it - Processor class. The thing is, that instantiation of Processor is rather costly (xslt engine) and doing so every time request arrives is out of question. I'd like to avoid making Processor class thread safe using synchronization primitives (and creating a bottleneck) or doing some object pooling. What I'd like to do is create an instance of Processor per event loop during bootstrap of my app. So is there any kind of event-loop-context where I can put objects (thread-locals abstraction)?
You could use plain old thread locals, if you are going to use the object within a single execution segment. That is, you can use it without needing to do anything async and therefore relinquish the thread. If you can’t guarantee that, then your next best option is to use an object pool. Netty provides quite a good one in http://netty.io/4.1/api/io/netty/util/Recycler.html.