use of org.glassfish.jersey.server.spi.RequestScopedInitializer in project jersey by jersey.
the class RequestResponseWrapperProvider method getRequestScopedInitializerProvider.
@Override
public RequestScopedInitializerProvider getRequestScopedInitializerProvider() {
return new RequestScopedInitializerProvider() {
@Override
public RequestScopedInitializer get(final RequestContextProvider context) {
return new RequestScopedInitializer() {
@Override
public void initialize(InjectionManager injectionManager) {
ServiceLocator locator = ((HK2InjectionManager) injectionManager).getServiceLocator();
locator.<Ref<HttpServletRequest>>getService(REQUEST_TYPE).set(finalWrap(context.getHttpServletRequest()));
locator.<Ref<HttpServletResponse>>getService(RESPONSE_TYPE).set(finalWrap(context.getHttpServletResponse()));
}
};
}
};
}
use of org.glassfish.jersey.server.spi.RequestScopedInitializer in project jersey by jersey.
the class ReferencesInitializer method apply.
/**
* Initialize the request references using the incoming request processing context.
*
* @param context incoming request context.
* @return same (unmodified) request context.
*/
@Override
public RequestProcessingContext apply(final RequestProcessingContext context) {
processingContextRefProvider.get().set(context);
final RequestScopedInitializer requestScopedInitializer = context.request().getRequestScopedInitializer();
if (requestScopedInitializer != null) {
requestScopedInitializer.initialize(injectionManager);
}
return context;
}
Aggregations