@Override protected void configure() { bindFactory(SimpleRequestReferencingFactory.class).to(Request.class).proxy(true) .proxyForSameScope(false).in(RequestScoped.class); bindFactory(ReferencingFactory.<Request>referenceFactory()) .to(new GenericType<Ref<Request>>() { }).in(RequestScoped.class); bindFactory(SimpleResponseReferencingFactory.class).to(Response.class).proxy(true) .proxyForSameScope(false).in(RequestScoped.class); bindFactory(ReferencingFactory.<Response>referenceFactory()) .to(new GenericType<Ref<Response>>() { }).in(RequestScoped.class); } }
@Override protected void configure() { bindFactory(SecurityContextRefFactory.class) .to(SecurityContext.class) .proxy(true) .proxyForSameScope(false) .in(RequestScoped.class); bindFactory(ReferencingFactory.<SecurityContext>referenceFactory()) .to(new GenericType<Ref<SecurityContext>>() { }) .in(RequestScoped.class); bind(security).to(Security.class); bind(featureConfig).to(FeatureConfig.class); } });
.proxy(true).proxyForSameScope(false).in(RequestScoped.class); .proxy(true).proxyForSameScope(false).in(RequestScoped.class); bindFactory(ReferencingFactory.referenceFactory()) .to(new GenericType<Ref<HttpServletResponse>>() {}).in(RequestScoped.class);
.proxy(true).proxyForSameScope(false).in(RequestScoped.class); .proxy(true).proxyForSameScope(false).in(RequestScoped.class); bindFactory(ReferencingFactory.referenceFactory()) .to(new GenericType<Ref<HttpServletResponse>>() {}).in(RequestScoped.class);
@Override protected void configure() { bindFactory(GrizzlyRequestReferencingFactory.class).to(Request.class) .proxy(false).in(RequestScoped.class); bindFactory(ReferencingFactory.<Request>referenceFactory()).to(new GenericType<Ref<Request>>() {}) .in(RequestScoped.class); bindFactory(GrizzlyResponseReferencingFactory.class).to(Response.class) .proxy(true).proxyForSameScope(false).in(RequestScoped.class); bindFactory(ReferencingFactory.<Response>referenceFactory()).to(new GenericType<Ref<Response>>() {}) .in(RequestScoped.class); } }
.proxy(true).proxyForSameScope(false) .in(RequestScoped.class); .proxy(true).proxyForSameScope(false) .in(RequestScoped.class); .proxy(true).proxyForSameScope(false) .in(RequestScoped.class);
.proxy(true).proxyForSameScope(false) .in(RequestScoped.class); .proxy(true).proxyForSameScope(false) .in(RequestScoped.class); .proxy(true).proxyForSameScope(false) .in(RequestScoped.class);
@Override protected void configure() { bindFactory(WebServerRequestReferencingFactory.class).to(ServerRequest.class) .proxy(false) .in(RequestScoped.class); bindFactory(ReferencingFactory.<ServerRequest>referenceFactory()).to(new GenericType<Ref<ServerRequest>>() { }) .in(RequestScoped.class); bindFactory(WebServerResponseReferencingFactory.class).to(ServerResponse.class) .proxy(true).proxyForSameScope(false) .in(RequestScoped.class); bindFactory(ReferencingFactory.<ServerResponse>referenceFactory()).to(new GenericType<Ref<ServerResponse>>() { }) .in(RequestScoped.class); bindFactory(SpanReferencingFactory.class).to(Span.class) .proxy(false) .in(RequestScoped.class).named(JerseySupport.REQUEST_SPAN_QUALIFIER); bindFactory(SpanContextReferencingFactory.class).to(SpanContext.class) .proxy(false) .in(RequestScoped.class).named(JerseySupport.REQUEST_SPAN_CONTEXT); bindFactory(ReferencingFactory.<Span>referenceFactory()).to(new GenericType<Ref<Span>>() { }) .in(RequestScoped.class); bindFactory(ReferencingFactory.<SpanContext>referenceFactory()).to(new GenericType<Ref<SpanContext>>() { }) .in(RequestScoped.class); }
@Override protected void configure() { bindFactory(AwsProxyServletContextSupplier.class) .proxy(true) .proxyForSameScope(true) .to(ServletContext.class) .in(RequestScoped.class); bindFactory(AwsProxyServletRequestSupplier.class) .proxy(true) .proxyForSameScope(true) .to(HttpServletRequest.class) .in(RequestScoped.class); bindFactory(AwsProxyServletResponseSupplier.class) .proxy(true) .proxyForSameScope(true) .to(HttpServletResponse.class) .in(RequestScoped.class); } });
.proxy(true).proxyForSameScope(false) .in(RequestScoped.class); .proxy(true).proxyForSameScope(false) .in(RequestScoped.class); .proxy(true).proxyForSameScope(false) .in(RequestScoped.class);
@Override protected void configure() { bindFactory(AwsProxyServletContextSupplier.class) .proxy(true) .proxyForSameScope(true) .to(ServletContext.class) .in(RequestScoped.class); bindFactory(AwsProxyServletRequestSupplier.class) .proxy(true) .proxyForSameScope(true) .to(HttpServletRequest.class) .in(RequestScoped.class); bindFactory(AwsProxyServletResponseSupplier.class) .proxy(true) .proxyForSameScope(true) .to(HttpServletResponse.class) .in(RequestScoped.class); } });
@Override protected void configure() { bindFactory(SimpleRequestReferencingFactory.class).to(Request.class).proxy(true) .proxyForSameScope(false).in(RequestScoped.class); bindFactory(ReferencingFactory.<Request>referenceFactory()) .to(new GenericType<Ref<Request>>() { }).in(RequestScoped.class); bindFactory(SimpleResponseReferencingFactory.class).to(Response.class).proxy(true) .proxyForSameScope(false).in(RequestScoped.class); bindFactory(ReferencingFactory.<Response>referenceFactory()) .to(new GenericType<Ref<Response>>() { }).in(RequestScoped.class); } }
/** * Binds the referencingFactory to the referenceType in the request scope * and allows proxying the reference type but not for the same scope. * <p> * It also binds a referencing factory to the referenceTypeLiteral in the * requestScope. * * @param referenceType * @param referencingFacatory * @param referenceTypeLiteral */ public final <T> void bindReferencingFactory(Class<T> referenceType, Class<? extends ReferencingFactory<T>> referencingFacatory, GenericType<Ref<T>> referenceTypeLiteral) { bindFactory(referencingFacatory) .to(referenceType) .proxy(true) .proxyForSameScope(false) .in(RequestScoped.class); bindFactory(ReferencingFactory.<T>referenceFactory()) .to(referenceTypeLiteral) .in(RequestScoped.class); } }
@Override protected void configure() { bindFactory(SecurityContextRefFactory.class) .to(SecurityContext.class) .proxy(true) .proxyForSameScope(false) .in(RequestScoped.class); bindFactory(ReferencingFactory.<SecurityContext>referenceFactory()) .to(new GenericType<Ref<SecurityContext>>() { }) .in(RequestScoped.class); bind(security).to(Security.class); bind(featureConfig).to(FeatureConfig.class); } });
.proxy(true).proxyForSameScope(false).in(RequestScoped.class); .proxy(true).proxyForSameScope(false).in(RequestScoped.class); bindFactory(ReferencingFactory.referenceFactory()) .to(new GenericType<Ref<HttpServletResponse>>() {}).in(RequestScoped.class);
@Override protected void configure() { bindFactory(GrizzlyRequestReferencingFactory.class).to(Request.class) .proxy(false).in(RequestScoped.class); bindFactory(ReferencingFactory.<Request>referenceFactory()).to(new GenericType<Ref<Request>>() {}) .in(RequestScoped.class); bindFactory(GrizzlyResponseReferencingFactory.class).to(Response.class) .proxy(true).proxyForSameScope(false).in(RequestScoped.class); bindFactory(ReferencingFactory.<Response>referenceFactory()).to(new GenericType<Ref<Response>>() {}) .in(RequestScoped.class); } }
.proxy(true).proxyForSameScope(false) .in(RequestScoped.class); .proxy(true).proxyForSameScope(false) .in(RequestScoped.class); .proxy(true).proxyForSameScope(false) .in(RequestScoped.class);
@Override protected void configure() { bindFactory(WebServerRequestReferencingFactory.class).to(ServerRequest.class) .proxy(false) .in(RequestScoped.class); bindFactory(ReferencingFactory.<ServerRequest>referenceFactory()).to(new GenericType<Ref<ServerRequest>>() { }) .in(RequestScoped.class); bindFactory(WebServerResponseReferencingFactory.class).to(ServerResponse.class) .proxy(true).proxyForSameScope(false) .in(RequestScoped.class); bindFactory(ReferencingFactory.<ServerResponse>referenceFactory()).to(new GenericType<Ref<ServerResponse>>() { }) .in(RequestScoped.class); bindFactory(SpanReferencingFactory.class).to(Span.class) .proxy(false) .in(RequestScoped.class).named(JerseySupport.REQUEST_SPAN_QUALIFIER); bindFactory(SpanContextReferencingFactory.class).to(SpanContext.class) .proxy(false) .in(RequestScoped.class).named(JerseySupport.REQUEST_SPAN_CONTEXT); bindFactory(ReferencingFactory.<Span>referenceFactory()).to(new GenericType<Ref<Span>>() { }) .in(RequestScoped.class); bindFactory(ReferencingFactory.<SpanContext>referenceFactory()).to(new GenericType<Ref<SpanContext>>() { }) .in(RequestScoped.class); }