/** * Start building a new generic type-based service binding. * <p> * Binds the generic service type itself as a contract type. * * @param serviceType generic service type information. * @return initialized binding builder. */ public ClassBinding<Object> bindAsContract(Type serviceType) { ClassBinding<Object> binding = Bindings.serviceAsContract(serviceType); internalBindings.add(binding); return binding; }
/** * Start building a new class-based service binding. * <p> * Binds the service type itself as a contract type. * * @param <T> service type. * @param serviceType service class. * @return initialized binding builder. */ public <T> ClassBinding<T> bindAsContract(Class<T> serviceType) { ClassBinding<T> binding = Bindings.serviceAsContract(serviceType); internalBindings.add(binding); return binding; }
/** * Start building a new generic type-based service binding. * <p> * Binds the generic service type itself as a contract type. * * @param serviceType generic service type information. * @return initialized binding builder. */ public ClassBinding<Object> bindAsContract(Type serviceType) { ClassBinding<Object> binding = Bindings.serviceAsContract(serviceType); internalBindings.add(binding); return binding; }
/** * Start building a new class-based service binding. * <p> * Binds the service type itself as a contract type. * * @param <T> service type. * @param serviceType service class. * @return initialized binding builder. */ public <T> ClassBinding<T> bindAsContract(Class<T> serviceType) { ClassBinding<T> binding = Bindings.serviceAsContract(serviceType); internalBindings.add(binding); return binding; }
/** * 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)); } }
/** * 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 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 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)); } });
binding = Bindings.serviceAsContract(resourceClass);
binding = Bindings.serviceAsContract(resourceClass);
if (providerModel != null) { Class<? extends Annotation> scope = providerModel.getScope(); descriptor = Bindings.serviceAsContract(resourceClass).in(scope); descriptor = Bindings.serviceAsContract(resourceClass).in(getScope(resourceClass));
if (providerModel != null) { Class<? extends Annotation> scope = providerModel.getScope(); descriptor = Bindings.serviceAsContract(resourceClass).in(scope); descriptor = Bindings.serviceAsContract(resourceClass).in(getScope(resourceClass));
injectionManager.register(Bindings.serviceAsContract(applicationClass).in(Singleton.class)); appClassBound = true;
injectionManager.register(Bindings.serviceAsContract(applicationClass).in(Singleton.class)); appClassBound = true;
/** * 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 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)); } });
binding = Bindings.serviceAsContract(resourceClass);
if (providerModel != null) { Class<? extends Annotation> scope = providerModel.getScope(); descriptor = Bindings.serviceAsContract(resourceClass).in(scope); descriptor = Bindings.serviceAsContract(resourceClass).in(getScope(resourceClass));
injectionManager.register(Bindings.serviceAsContract(applicationClass).in(Singleton.class)); appClassBound = true;
/** * 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)); } }