T
- type of the configuration object to be usedpublic abstract class AbstractLegacyTool<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
CONFIGURATION_ERROR
There was an configuration error.
|
protected boolean |
help
true if help should be displayed.
|
protected Configuration |
kiekerConfiguration
configuration provided as kieker configuration file.
|
protected org.slf4j.Logger |
logger
logger for all tools.
|
static int |
PARAMETER_ERROR
There was a parameter error.
|
protected T |
parameterConfiguration
configuration specified as parameters.
|
static int |
RUNTIME_ERROR
An runtime error happened.
|
static int |
SUCCESS_EXIT_CODE
Exit code for successful operation.
|
static int |
USAGE_EXIT_CODE
Displayed the usage message.
|
Constructor and Description |
---|
AbstractLegacyTool()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
checkConfiguration(Configuration configuration,
com.beust.jcommander.JCommander commander)
Check a given configuration for validity.
|
protected abstract boolean |
checkParameters(com.beust.jcommander.JCommander commander)
Check all given parameters for correct directory and files path, as well as, all other values
for fitness.
|
protected abstract int |
execute(com.beust.jcommander.JCommander commander,
java.lang.String label)
Execute the core part of a tool or service.
|
protected abstract java.io.File |
getConfigurationFile()
Method returning the configuration file handle.
|
protected Configuration |
readConfiguration()
Read a configuration form a file.
|
int |
run(java.lang.String title,
java.lang.String label,
java.lang.String[] args,
T configuration)
Configure and execute the evaluation tool utilizing an external configuration.
|
protected abstract void |
shutdownService()
Trigger cleanup features of the service.
|
public static final int SUCCESS_EXIT_CODE
public static final int RUNTIME_ERROR
public static final int CONFIGURATION_ERROR
public static final int PARAMETER_ERROR
public static final int USAGE_EXIT_CODE
protected final org.slf4j.Logger logger
protected boolean help
protected T parameterConfiguration
protected Configuration kiekerConfiguration
public int run(java.lang.String title, java.lang.String label, java.lang.String[] args, T configuration)
title
- start up label for debug messageslabel
- label used during execution to indicate the running serviceargs
- arguments are ignoredconfiguration
- configuration objectprotected abstract int execute(com.beust.jcommander.JCommander commander, java.lang.String label) throws ConfigurationException
commander
- JCommander instance used to display usage information in case of errorslabel
- label used during execution to indicate the running serviceConfigurationException
- on configuration errors occuring at runtimeprotected Configuration readConfiguration()
protected abstract java.io.File getConfigurationFile()
protected abstract boolean checkConfiguration(Configuration configuration, com.beust.jcommander.JCommander commander)
configuration
- the configuration object with all configuration parameter. Can be null.commander
- JCommander used to generate usage information.protected abstract boolean checkParameters(com.beust.jcommander.JCommander commander) throws ConfigurationException
commander
- the command line interfaceConfigurationException
- on errorprotected abstract void shutdownService()
Copyright 2020 Kieker Project, http://kieker-monitoring.net