/** * Method is able to create form incoming class and {@link Binding jersey descriptor} a {@link ForeignDescriptor} which is * provided by underlying DI provider. * * @param clazz class from which jersey-like descriptor is created. * @return foreign descriptor of the underlying DI provider. */ private ForeignDescriptor createDescriptor(Class<?> clazz) { return foreignDescriptorFactory.apply(Bindings.serviceAsContract(clazz).in(RequestScoped.class)); } }
@Override protected void configure() { bind(SessionFactoryProvider.class).to(ValueParamProvider.class).in(Singleton.class); } }
@Override protected void configure() { bind(PlaintextMethod.class).to(OAuth1SignatureMethod.class).in(Singleton.class); bind(RsaSha1Method.class).to(OAuth1SignatureMethod.class).in(Singleton.class); bind(HmaSha1Method.class).to(OAuth1SignatureMethod.class).in(Singleton.class); bindAsContract(OAuth1Signature.class).in(Singleton.class); } }
@Override protected void configure() { bindAsContract(NaiveResourceLinkContributionContext.class) .to(ResourceLinkContributionContext.class).in(Singleton.class); } });
@Override public ForeignDescriptor apply(Class<?> key) { // below we make sure HK2 behaves as if injection happens into a request scoped type // this is to avoid having proxies injected (see JERSEY-2386) // before touching the following statement, check BeanParamMemoryLeakTest first! return injectionManager .createForeignDescriptor(Bindings.serviceAsContract(key).in(RequestScoped.class)); } });
@Override protected void configure() { bindAsContract(NaiveResourceMappingContext.class) .to(ResourceMappingContext.class).in(Singleton.class); } });
@Override protected void configure() { bind(JaxbStringReaderProvider.RootElementProvider.class).to(ParamConverterProvider.class).in(Singleton.class); } }
@Override protected void configure() { bind(WadlApplicationContextImpl.class).to(WadlApplicationContext.class).in(Singleton.class); } });
@Override protected void configure() { bindAsContract(MonitoringContainerListener.class) .to(ContainerLifecycleListener.class).in(Singleton.class); } }
@Override public ForeignDescriptor apply(Class<?> key) { // below we make sure HK2 behaves as if injection happens into a request scoped type // this is to avoid having proxies injected (see JERSEY-2386) // before touching the following statement, check BeanParamMemoryLeakTest first! return injectionManager .createForeignDescriptor(Bindings.serviceAsContract(key).in(RequestScoped.class)); } });
@Override protected void configure() { bind(TemplateMethodInterceptor.class).to(WriterInterceptor.class).in(Singleton.class); //noinspection unchecked bind(ViewableMessageBodyWriter.class).to(MessageBodyWriter.class).in(Singleton.class); bind(TemplateModelProcessor.class).to(ModelProcessor.class).in(Singleton.class); bindAsContract(ResolvingViewableContext.class).in(Singleton.class); bind(ResolvingViewableContext.class).to(ViewableContext.class).in(Singleton.class).ranked(Integer.MIN_VALUE); } }
@Override protected void configure() { bindAsContract(MoxyObjectProvider.class) // FilteringObjectProvider. .to(new GenericType<ObjectProvider<ObjectGraph>>() {}) // FilteringGraphTransformer. .to(new GenericType<ObjectGraphTransformer<ObjectGraph>>() {}) // Scope. .in(Singleton.class); } }
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { injectionManager.register( Bindings.service(JaxrsProviders.class) .to(Providers.class) .in(PerLookup.class)); } }
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { injectionManager.register( Bindings.service(JaxrsProviders.class) .to(Providers.class) .in(PerLookup.class)); } }
@Override protected void configure() { install(new MappableExceptionWrapperInterceptor.Binder(), new MonitoringContainerListener.Binder()); //ChunkedResponseWriter bind(ChunkedResponseWriter.class).to(MessageBodyWriter.class).in(Singleton.class); // JSONP bind(JsonWithPaddingInterceptor.class).to(WriterInterceptor.class).in(Singleton.class); } }
@Override protected void configure() { install(new MappableExceptionWrapperInterceptor.Binder(), new MonitoringContainerListener.Binder()); //ChunkedResponseWriter bind(ChunkedResponseWriter.class).to(MessageBodyWriter.class).in(Singleton.class); // JSONP bind(JsonWithPaddingInterceptor.class).to(WriterInterceptor.class).in(Singleton.class); } }
@Override protected void configure() { bindFactory(DefaultConfigurationProvider.class, Singleton.class).to(Configuration.class).in(Singleton.class); bindFactory(DefaultValidatorFactoryProvider.class, Singleton.class).to(ValidatorFactory.class).in(Singleton.class); bindFactory(DefaultValidatorProvider.class, Singleton.class).to(Validator.class).in(Singleton.class); bindFactory(ConfiguredValidatorProvider.class, Singleton.class).to(ConfiguredValidator.class); // Custom Exception Mapper and Writer - registering in binder to make possible for users register their own providers. bind(ValidationExceptionMapper.class).to(ExceptionMapper.class).in(Singleton.class); bind(ValidationErrorMessageBodyWriter.class).to(MessageBodyWriter.class).in(Singleton.class); }
@Override protected void configure() { bindFactory(ReferencingFactory.<MonitoringStatistics>referenceFactory()) .to(new GenericType<Ref<MonitoringStatistics>>() { }) .in(Singleton.class); bindFactory(StatisticsInjectionFactory.class).to(MonitoringStatistics.class); bind(StatisticsListener.class).to(MonitoringStatisticsListener.class).in(Singleton.class); } });