PropertyInjector propertyInjector = resourceFactory.getPropertyInjector();
HttpRequest request = ResteasyProviderFactory.getContextData(HttpRequest.class);
if (isSingleton(beanName) || request == null)
{
propertyInjector.inject(bean);
}
else
{
HttpResponse response = ResteasyProviderFactory.getContextData(HttpResponse.class);
propertyInjector.inject(request, response, bean);