Package io.dropwizard.core.cli
Class ServerCommand<T extends Configuration>
java.lang.Object
io.dropwizard.core.cli.Command
io.dropwizard.core.cli.ConfiguredCommand<T>
io.dropwizard.core.cli.EnvironmentCommand<T>
io.dropwizard.core.cli.ServerCommand<T>
- Type Parameters:
T
- theConfiguration
subclass which is loaded from the configuration file
Runs an application as an HTTP server.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionServerCommand
(Application<T> application) protected
ServerCommand
(Application<T> application, String name, String description) A constructor to allow reuse of the server command as a different name -
Method Summary
Modifier and TypeMethodDescriptionReturns theClass
of the configuration type.protected void
run
(Environment environment, net.sourceforge.argparse4j.inf.Namespace namespace, T configuration) Runs the command with the givenEnvironment
andConfiguration
.Methods inherited from class io.dropwizard.core.cli.EnvironmentCommand
getEnvironment, run
Methods inherited from class io.dropwizard.core.cli.ConfiguredCommand
addFileArgument, cleanup, cleanupAsynchronously, configure, getConfiguration, run
Methods inherited from class io.dropwizard.core.cli.Command
getDescription, getName, onError
-
Constructor Details
-
ServerCommand
-
ServerCommand
A constructor to allow reuse of the server command as a different name- Parameters:
application
- the application using this commandname
- the argument name to invoke this commanddescription
- a summary of what the command does
-
-
Method Details
-
getConfigurationClass
Description copied from class:ConfiguredCommand
Returns theClass
of the configuration type.- Overrides:
getConfigurationClass
in classConfiguredCommand<T extends Configuration>
- Returns:
- the
Class
of the configuration type
-
run
protected void run(Environment environment, net.sourceforge.argparse4j.inf.Namespace namespace, T configuration) throws Exception Description copied from class:EnvironmentCommand
Runs the command with the givenEnvironment
andConfiguration
.- Specified by:
run
in classEnvironmentCommand<T extends Configuration>
- Parameters:
environment
- the configured environmentnamespace
- the parsed command line namespaceconfiguration
- the configuration object- Throws:
Exception
- if something goes wrong
-