コード例 #1
0
 @Override
 protected void configure() {
   DynamicSet.bind(binder(), UploadValidationListener.class).to(DisplayMotd.class);
   bind(OnStartStop.class).in(Scopes.SINGLETON);
   bind(LifecycleListener.class).annotatedWith(UniqueAnnotations.create()).to(OnStartStop.class);
   bind(MotdConfig.class).to(MotdFileBasedConfig.class);
 }
コード例 #2
0
 /**
  * Binds the specified {@link CommandHandler} instance class.
  *
  * @param commandClass The command class.
  * @param handlerClass The command handler class.
  */
 protected final <C extends Command<R>, R extends Result, H extends CommandHandler<C, R>>
     void bindHandler(final Class<C> commandClass, final Class<H> handlerClass) {
   bind(CommandHandlerMap.class)
       .annotatedWith(UniqueAnnotations.create())
       .toInstance(new CommandHandlerMapImpl<C, R>(commandClass, handlerClass));
 }