Class CommandSupport
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.module.installer.internal.CommandSupport
-
public final class CommandSupport extends java.lang.ObjectProvides support for commands injection support and classpath scanning resolution of commands.- Since:
- 01.09.2014
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidinitCommands(java.util.List<io.dropwizard.core.cli.Command> commands, com.google.inject.Injector injector, StatsTracker tracker)Inject dependencies into all registered environment commands.static java.util.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.
-
-
-
Method Detail
-
registerCommands
public static java.util.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, butEnvironmentCommandmust have constructor withApplicationargument.- Parameters:
bootstrap- bootstrap objectscanner- configured scanner instancecontext- configuration context- Returns:
- list of installed commands
-
initCommands
public static void initCommands(java.util.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 commandsinjector- guice injector objecttracker- stats tracker
-
-