Package kieker.tools.common
Class AbstractLegacyTool<T>
java.lang.Object
kieker.tools.common.AbstractLegacyTool<T>
- Type Parameters:
T- type of the configuration object to be used
- Direct Known Subclasses:
AbstractService
Generic legacy tool framework class.
- Since:
- 1.15
- Author:
- Reiner Jung
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThere was an configuration error.protected booleantrue if help should be displayed.protected Configurationconfiguration provided as kieker configuration file.protected final org.slf4j.Loggerlogger for all tools.static final intThere was a parameter error.static final intAn runtime error happened.protected Tconfiguration specified as parameters.static final intExit code for successful operation.static final intDisplayed the usage message. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleancheckConfiguration(Configuration configuration, com.beust.jcommander.JCommander commander) Check a given configuration for validity.protected abstract booleancheckParameters(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 intExecute the core part of a tool or service.protected abstract PathMethod returning the configuration file handle.protected ConfigurationRead a configuration form a file.intConfigure and execute the evaluation tool utilizing an external configuration.protected abstract voidTrigger cleanup features of the service.
-
Field Details
-
SUCCESS_EXIT_CODE
public static final int SUCCESS_EXIT_CODEExit code for successful operation.- See Also:
-
RUNTIME_ERROR
public static final int RUNTIME_ERRORAn runtime error happened.- See Also:
-
CONFIGURATION_ERROR
public static final int CONFIGURATION_ERRORThere was an configuration error.- See Also:
-
PARAMETER_ERROR
public static final int PARAMETER_ERRORThere was a parameter error.- See Also:
-
USAGE_EXIT_CODE
public static final int USAGE_EXIT_CODEDisplayed the usage message.- See Also:
-
logger
protected final org.slf4j.Logger loggerlogger for all tools. -
help
protected boolean helptrue if help should be displayed. -
settings
configuration specified as parameters. -
kiekerConfiguration
configuration provided as kieker configuration file.
-
-
Constructor Details
-
AbstractLegacyTool
public AbstractLegacyTool()Default constructor.
-
-
Method Details
-
run
Configure and execute the evaluation tool utilizing an external configuration.- Parameters:
title- start up label for debug messageslabel- label used during execution to indicate the running serviceargs- arguments are ignoredconfiguration- configuration object- Returns:
- returns exit code
-
execute
protected abstract int execute(com.beust.jcommander.JCommander commander, String label) throws ConfigurationException Execute the core part of a tool or service.- Parameters:
commander- JCommander instance used to display usage information in case of errorslabel- label used during execution to indicate the running service- Returns:
- returns exit code
- Throws:
ConfigurationException- on configuration errors occuring at runtime
-
readConfiguration
Read a configuration form a file.- Returns:
- returns a complete Kieker configuration
-
getConfigurationPath
Method returning the configuration file handle.- Returns:
- returns a file handle in case a configuration file is used, else null
-
checkConfiguration
protected abstract boolean checkConfiguration(Configuration configuration, com.beust.jcommander.JCommander commander) Check a given configuration for validity.- Parameters:
configuration- the configuration object with all configuration parameter. Can be null.commander- JCommander used to generate usage information.- Returns:
- true if the configuration is valid.
-
checkParameters
protected abstract boolean checkParameters(com.beust.jcommander.JCommander commander) throws ConfigurationException Check all given parameters for correct directory and files path, as well as, all other values for fitness.- Parameters:
commander- the command line interface- Returns:
- true if all parameter check out, else false
- Throws:
ConfigurationException- on error
-
shutdownService
protected abstract void shutdownService()Trigger cleanup features of the service.
-