title: Share variables between JAX-RS requests
body: <p>I have what I think is a very basic question about JAX-RS but I somehow can't easily find the answer.</p>
  
  <p>I am trying to refactor a REST service which uses a "standard" Javax servlet -- routing requests to methods by hand -- into an "cleaner" JAX-RS implementation. The current application sets some variables during the servlet init(). It assigns those as attributes of the HttpServlet class so they are available during each doGet() and can be passed as parameters to request processing methods. For clarity, one of these is a ConcurentHashMap that acts as a cache.</p>
  
  <p>Now, with JAX-RS, I can extend Application to set my resource classes. I can also use the @Context annotation in each resource implementation to inject things like ServletContext when processing a request. But I do not know how to similarly inject variables set during application initialization.</p>
  
  <p>I am using the Apache Wink 1.3.0 implementation of JAX-RS.</p>