java.lang.Object
ru.vyarus.dropwizard.guice.module.installer.internal.CommandSupport

public final class CommandSupport extends Object
Provides support for commands injection support and classpath scanning resolution of commands.
Since:
01.09.2014
  • Method Details

    • registerCommands

      public static List<io.dropwizard.core.cli.Command> registerCommands(io.dropwizard.core.setup.Bootstrap bootstrap, ClasspathScanner scanner, ConfigurationContext context)
      Scans classpath to find commands and register them. Commands are instantiated using default constructor, but EnvironmentCommand must have constructor with Application argument.
      Parameters:
      bootstrap - bootstrap object
      scanner - configured scanner instance
      context - configuration context
      Returns:
      list of installed commands
    • initCommands

      public static void initCommands(List<io.dropwizard.core.cli.Command> commands, com.google.inject.Injector injector, StatsTracker tracker)
      Inject dependencies into all registered environment commands. (only field and setter injection could be used) There is no need to process other commands, because only environment commands will run bundles and so will start the injector.
      Parameters:
      commands - registered commands
      injector - guice injector object
      tracker - stats tracker