public interface Service
Modifier and Type | Interface and Description |
---|---|
static interface |
Service.Builder
A builder for a new service.
|
static interface |
Service.Instance
A running service instance.
|
static interface |
Service.Signaller
A way of sending signals to a service instance.
|
Modifier and Type | Method and Description |
---|---|
String |
getServiceName()
Returns the name of this service.
|
Service.Instance |
start(String... args)
Starts a new instance of this service that is fully initialized.
|
Service.Instance |
start(String[] args,
com.typesafe.config.Config config)
Starts a new instance of this service that is fully initialized.
|
Service.Instance |
start(String[] args,
Map<String,String> env)
Starts a new instance of this service that is fully initialized.
|
String getServiceName()
Service.Instance start(String... args) throws IOException
args
- Command-line arguments for the service.ApolloHelpException
- if the user wants to show command-line help and not start the
application.ApolloCliException
- if something else related to CLI parsing failed.IOException
- if the application could not start for some other reason.Service.Instance start(String[] args, Map<String,String> env) throws IOException
env
.args
- Command-line arguments for the service.env
- Environment variables for the service. These are not additional environment
variables, but instead replaces the set of environment variables that Apollo sees,
generally used for testing.ApolloHelpException
- if the user wants to show command-line help and not start the
application.ApolloCliException
- if something else related to CLI parsing failed.IOException
- if the application could not start for some other reason.Service.Instance start(String[] args, com.typesafe.config.Config config) throws IOException
config
passed as an argument and the environment variables.args
- Command-line arguments for the service.config
- Configuration for the service.ApolloHelpException
- if the user wants to show command-line help and not start the
application.ApolloCliException
- if something else related to CLI parsing failed.IOException
- if the application could not start for some other reason.Copyright © 2016. All rights reserved.