title: Autowiring a spring managed bean in the resteasy providers
body: <p>I have a developing a webservice where in i need to validate a particular httpheader sent in the request against the database.</p>
  
  <p>I want to use RestEasy provider for doing the same as the same functionality needs to be applied to all the service.</p>
  
  <pre><code>@Provider
  @ServerInterceptor
  public class TestValidationInterceptor implements PreProcessInterceptor      {
  
  @Autowired
  DetailsDelegate detailsDelegate;
  
  @Override
  public ServerResponse preProcess(HttpRequest request, ResourceMethod method) throws Failure, WebApplicationException {
      //code to get data using detailsDelegate.
      return null;
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>    public interface DetailsDelegate {
  
  String BEAN_ID = "DetailsDelegate";
  
  /**
   * @param appName
   * @return
   * @throws BaseException
   */
  ServiceInfo getServiceDetails(String appName) throws BaseException;
   }
  </code></pre>
  
  <hr>
  
  <pre><code>@Service("detailsDelegate")
  public class DetailsDelegateImpl implements DetailsDelegate {
  
  
  @Override
  public ServiceInfo getServiceDetails(String appName) throws BaseException {
      return null;
     }
  }
  </code></pre>
  
  <p>The detailsDelegate instance is not getting autowired and is null. </p>
  
  <p>Can someone explain why I am facing this issue.</p>