Package org.fugerit.java.tool
Class ToolHandlerHelper
- java.lang.Object
-
- org.fugerit.java.tool.ToolHandlerHelper
-
- All Implemented Interfaces:
ToolHandler
- Direct Known Subclasses:
CharsetCorrect
,ExportQuery
,ExtractFixedConfigHandler
,FixedToExcel
,LoggerTest
,SendMail
public abstract class ToolHandlerHelper extends Object implements ToolHandler
Basic class for the tool handler interface.
- Author:
- Fugerit
-
-
Field Summary
Fields Modifier and Type Field Description static String
ARG_EXTRA_JAR
static int
EXIT_KO_DEFAULT
protected static String
LOG_PARAM_LITERAL
protected static org.slf4j.Logger
logger
-
Fields inherited from interface org.fugerit.java.tool.ToolHandler
EXIT_OK
-
-
Constructor Summary
Constructors Constructor Description ToolHandlerHelper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ClassLoader
getClassLoader(Properties params)
String
getHelp()
Generate the heklp for current Toolint
handle(Properties params)
Does the operation of this handler.abstract int
handleWorker(Properties params)
Handler worker method.
-
-
-
Field Detail
-
logger
protected static final org.slf4j.Logger logger
-
LOG_PARAM_LITERAL
protected static final String LOG_PARAM_LITERAL
- See Also:
- Constant Field Values
-
ARG_EXTRA_JAR
public static final String ARG_EXTRA_JAR
- See Also:
- Constant Field Values
-
EXIT_KO_DEFAULT
public static final int EXIT_KO_DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
handleWorker
public abstract int handleWorker(Properties params) throws RunToolException
Handler worker method.
- Parameters:
params
- ths params for the tool- Returns:
- exit code (0 is all ok)
- Throws:
RunToolException
- issues if problems arise
-
handle
public int handle(Properties params) throws Exception
Description copied from interface:ToolHandler
Does the operation of this handler.
- Specified by:
handle
in interfaceToolHandler
- Parameters:
params
- the params- Returns:
- the result code of the operation
- Throws:
Exception
- if issues arises
-
getClassLoader
protected ClassLoader getClassLoader(Properties params)
-
getHelp
public String getHelp()
Generate the heklp for current Tool- Returns:
- Help text
-
-