Package com.codingchili.core.context
Class LaunchContext
java.lang.Object
com.codingchili.core.context.LaunchContext
Provides context for the Launcher system, passed to the launcher when starting an application
using the
Launcher
subsystem.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionString[]
args()
io.vertx.core.Future<CommandResult>
execute()
getCommand(Command command)
adds a new command to the command executor, is used to handle command line arguments.Get the CommandExecutor attached to the launch context.logger()
services()
Retrieves a block of services that should be deployed.Get the configured services for the given blocks or remote identifier.setCommandExecutor(CommandExecutor executor)
Set the command handler used to parse and execute command line arguments.settings()
void
start()
Starts the launcher using this context.
-
Constructor Details
-
LaunchContext
- Parameters:
args
- process arguments to create a launcher for.
-
-
Method Details
-
settings
- Returns:
- the launcher settings, must be modified before starting the launcher.
-
service
- Parameters:
block
- see link.- Returns:
- see link.
- Throws:
CoreException
- see link.- See Also:
services(List)
-
services
Get the configured services for the given blocks or remote identifier.- Parameters:
blocks
- the handler of the configured block or the hostname.- Returns:
- a list of configured services for the given block or host.
- Throws:
RemoteBlockNotConfiguredException
- when no block is configured for given host.BlockNotConfiguredException
- when no block is configured for given block-handler.CoreException
-
args
- Returns:
- the commandline arguments that was passed to the constructor.
-
services
Retrieves a block of services that should be deployed. If no block is explicitly set as the second argument then the block is inferred from the host-to-block mappings. if there is no such mapping the 'default' block is deployed, if one is specified.- Returns:
- a list of services to be deployed for the given arguments.
- Throws:
CoreException
- when the specified block does not exist or when no blocks are specified that match the host and the 'default' block is missing.
-
blockNames
- Returns:
- the name of the block being deployed.
-
getCommand
- Returns:
- the command that was passed to the launcher if existing.
-
logger
- Returns:
- the active logger for the current context.
-
getCommand
adds a new command to the command executor, is used to handle command line arguments.- Parameters:
command
- the command to add.- Returns:
- fluent.
-
setCommandExecutor
Set the command handler used to parse and execute command line arguments.- Parameters:
executor
- the executor to execute commands with.- Returns:
- fluent.
-
execute
- Returns:
- future resolved when the command executor for the launch context has executed.
-
getExecutor
Get the CommandExecutor attached to the launch context.- Returns:
- fluent
-
start
public void start()Starts the launcher using this context.
-