/** * Implement to provide binding definitions using the exposed binding * methods. */ @Override protected void configure() { // Bind the vertx and container instances bind(vertx).to(Vertx.class); bind(container).to(Container.class); // Request and read stream bindFactory(VertxRequestReferencingFactory.class).to(HttpServerRequest.class).in(PerLookup.class); bindFactory(VertxRequestReferencingFactory.class).to(new TypeLiteral<ReadStream<HttpServerRequest>>() { }).in(PerLookup.class); bindFactory(ReferencingFactory.<HttpServerRequest>referenceFactory()).to(new TypeLiteral<Ref<HttpServerRequest>>() { }).in(RequestScoped.class); // Response bindFactory(VertxResponseReferencingFactory.class).to(HttpServerResponse.class).in(PerLookup.class); bindFactory(ReferencingFactory.<HttpServerResponse>referenceFactory()).to(new TypeLiteral<Ref<HttpServerResponse>>() { }).in(RequestScoped.class); } }
@Test public void testConfigure() throws Exception { InternalVertxJerseyBinder binder = new InternalVertxJerseyBinder(mock(Vertx.class)); DynamicConfiguration dynamicConfiguration = mock(DynamicConfiguration.class); binder.bind(dynamicConfiguration); }
/** * Implement to provide binding definitions using the exposed binding * methods. */ @Override protected void configure() { // Bind the vertx and container instances bind(vertx).to(Vertx.class); // Request and read stream bindFactory(VertxRequestReferencingFactory.class).to(HttpServerRequest.class).in(PerLookup.class); bindFactory(VertxRequestReferencingFactory.class).to(new TypeLiteral<ReadStream<HttpServerRequest>>() { }).in(PerLookup.class); bindFactory(ReferencingFactory.<HttpServerRequest>referenceFactory()).to(new TypeLiteral<Ref<HttpServerRequest>>() { }).in(RequestScoped.class); // Response bindFactory(VertxResponseReferencingFactory.class).to(HttpServerResponse.class).in(PerLookup.class); bindFactory(ReferencingFactory.<HttpServerResponse>referenceFactory()).to(new TypeLiteral<Ref<HttpServerResponse>>() { }).in(RequestScoped.class); } }
/** * Implement to provide binding definitions using the exposed binding * methods. */ @Override protected void configure() { // Bind the vertx and container instances bind(vertx).to(Vertx.class); // Request and read stream bindFactory(VertxRequestReferencingFactory.class).to(HttpServerRequest.class).in(PerLookup.class); bindFactory(VertxRequestReferencingFactory.class).to(new TypeLiteral<ReadStream<HttpServerRequest>>() { }).in(PerLookup.class); bindFactory(ReferencingFactory.<HttpServerRequest>referenceFactory()).to(new TypeLiteral<Ref<HttpServerRequest>>() { }).in(RequestScoped.class); // Response bindFactory(VertxResponseReferencingFactory.class).to(HttpServerResponse.class).in(PerLookup.class); bindFactory(ReferencingFactory.<HttpServerResponse>referenceFactory()).to(new TypeLiteral<Ref<HttpServerResponse>>() { }).in(RequestScoped.class); } }