/** * Bind this binding key to the given provider class. * * The dependency injection framework will instantiate and inject this provider, and then invoke its `get` method * whenever an instance of the class is needed. */ public <P extends Provider<? extends T>> Binding<T> toProvider(final Class<P> provider) { return underlying.toProvider(provider).asJava(); }
@SuppressWarnings(value = "unchecked") private static Result invokeHandler(play.api.Application app, play.api.mvc.Handler handler, Request requestBuilder, long timeout) { if (handler instanceof play.api.mvc.Action) { play.api.mvc.Action action = (play.api.mvc.Action) handler; return wrapScalaResult(action.apply(requestBuilder.asScala()), timeout); } else if (handler instanceof JavaHandler) { final play.api.inject.Injector injector = app.injector(); final JavaHandlerComponents handlerComponents = injector.instanceOf(JavaHandlerComponents.class); return invokeHandler( app, ((JavaHandler) handler).withComponents(handlerComponents), requestBuilder, timeout ); } else { throw new RuntimeException("This is not a JavaAction and can't be invoked this way."); } }
/** * Bind this binding key to the given instance. */ public Binding<T> toInstance(final T instance) { return underlying.toInstance(instance).asJava(); }
@SuppressWarnings(value = "unchecked") private static Result invokeHandler(play.api.Application app, play.api.mvc.Handler handler, Request requestBuilder, long timeout) { if (handler instanceof play.api.mvc.Action) { play.api.mvc.Action action = (play.api.mvc.Action) handler; return wrapScalaResult(action.apply(requestBuilder.asScala()), timeout); } else if (handler instanceof JavaHandler) { final play.api.inject.Injector injector = app.injector(); final JavaHandlerComponents handlerComponents = injector.instanceOf(JavaHandlerComponents.class); return invokeHandler( app, ((JavaHandler) handler).withComponents(handlerComponents), requestBuilder, timeout ); } else { throw new RuntimeException("This is not a JavaAction and can't be invoked this way."); } }
/** * Bind this binding key to the given provider class. * * The dependency injection framework will instantiate and inject this provider, and then invoke its `get` method * whenever an instance of the class is needed. */ public <P extends Provider<? extends T>> Binding<T> toProvider(final Class<P> provider) { return underlying.toProvider(provider).asJava(); }
/** * Bind this binding key to the given instance. */ public Binding<T> toInstance(final T instance) { return underlying.toInstance(instance).asJava(); }
scala.PartialFunction$.MODULE$.<scala.Tuple2<String, String>, Handler>empty() ); this.configuration = application.injector().instanceOf(Configuration.class); this.injector = application.injector().instanceOf(Injector.class);
/** * Bind this binding key to the given provider class. * * The dependency injection framework will instantiate and inject this provider, and then invoke its `get` method * whenever an instance of the class is needed. */ public <P extends Provider<? extends T>> Binding<T> toProvider(final Class<P> provider) { return underlying.toProvider(provider).asJava(); }
/** * Bind this binding key to the given instance. */ public Binding<T> toInstance(final T instance) { return underlying.toInstance(instance).asJava(); }