예제 #1
0
 /**
  * Get a new factory class-based service binding builder.
  *
  * @param <T> service type.
  * @param factoryType service factory class.
  * @param factoryScope factory scope.
  * @return initialized binding builder.
  */
 public static <T> ServiceBindingBuilder<T> newFactoryBinder(
     Class<? extends Factory<T>> factoryType, Class<? extends Annotation> factoryScope) {
   return AbstractBindingBuilder.<T>createFactoryBinder(factoryType, factoryScope);
 }
예제 #2
0
 /**
  * Get a new class-based service binding builder.
  *
  * <p>Does NOT bind the service type itself as a contract type.
  *
  * @param <T> service type.
  * @param serviceType service class.
  * @return initialized binding builder.
  */
 public static <T> ServiceBindingBuilder<T> newBinder(Class<T> serviceType) {
   return AbstractBindingBuilder.create(serviceType, false);
 }
예제 #3
0
 /**
  * Get a new instance-based service binding builder. The binding is naturally considered to be a
  * {@link javax.inject.Singleton singleton-scoped}.
  *
  * <p>Does NOT bind the service type itself as a contract type.
  *
  * @param <T> service type.
  * @param service service instance.
  * @return initialized binding builder.
  */
 public static <T> ScopedBindingBuilder<T> newBinder(T service) {
   return AbstractBindingBuilder.create(service);
 }
예제 #4
0
 /**
  * Get a new factory instance-based service binding builder.
  *
  * @param <T> service type.
  * @param factory service instance.
  * @return initialized binding builder.
  */
 public static <T> ServiceBindingBuilder<T> newFactoryBinder(Factory<T> factory) {
   return AbstractBindingBuilder.createFactoryBinder(factory);
 }