Package io.dropwizard.cli
Class ServerCommand<T extends Configuration>
- java.lang.Object
-
- io.dropwizard.cli.Command
-
- io.dropwizard.cli.ConfiguredCommand<T>
-
- io.dropwizard.cli.EnvironmentCommand<T>
-
- io.dropwizard.cli.ServerCommand<T>
-
- Type Parameters:
T- theConfigurationsubclass which is loaded from the configuration file
public class ServerCommand<T extends Configuration> extends EnvironmentCommand<T>
Runs a application as an HTTP server.
-
-
Constructor Summary
Constructors Modifier Constructor Description ServerCommand(Application<T> application)protectedServerCommand(Application<T> application, String name, String description)A constructor to allow reuse of the server command as a different name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<T>getConfigurationClass()Returns theClassof the configuration type.protected voidrun(Environment environment, net.sourceforge.argparse4j.inf.Namespace namespace, T configuration)Runs the command with the givenEnvironmentandConfiguration.-
Methods inherited from class io.dropwizard.cli.EnvironmentCommand
run
-
Methods inherited from class io.dropwizard.cli.ConfiguredCommand
addFileArgument, cleanup, cleanupAsynchronously, configure, run
-
Methods inherited from class io.dropwizard.cli.Command
getDescription, getName, onError
-
-
-
-
Constructor Detail
-
ServerCommand
public ServerCommand(Application<T> application)
-
ServerCommand
protected ServerCommand(Application<T> application, String name, String description)
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 Detail
-
getConfigurationClass
protected Class<T> getConfigurationClass()
Description copied from class:ConfiguredCommandReturns theClassof the configuration type.- Overrides:
getConfigurationClassin classConfiguredCommand<T extends Configuration>- Returns:
- the
Classof the configuration type
-
run
protected void run(Environment environment, net.sourceforge.argparse4j.inf.Namespace namespace, T configuration) throws Exception
Description copied from class:EnvironmentCommandRuns the command with the givenEnvironmentandConfiguration.- Specified by:
runin classEnvironmentCommand<T extends Configuration>- Parameters:
environment- the configured environmentnamespace- the parsed command line namespaceconfiguration- the configuration object- Throws:
Exception- if something goes wrong
-
-