public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException
{
SpringResourceFactory resourceFactory = resourceFactories.get(beanName);
if (resourceFactory == null) return bean;
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);
}
return bean;
}