public abstract class CliBase extends Object implements org.apache.uima.ducc.cli.IUiOptions
Modifier and Type | Field and Description |
---|---|
protected org.apache.uima.ducc.common.utils.DuccProperties |
cli_props |
protected org.apache.uima.ducc.cli.CommandLine |
commandLine |
protected boolean |
console_attach |
protected org.apache.uima.ducc.cli.ConsoleListener |
console_listener |
protected IDuccCallback |
consoleCb |
protected boolean |
debug |
protected org.apache.uima.ducc.transport.dispatcher.IDuccEventDispatcher |
dispatcher |
protected String |
ducc_home |
protected ArrayList<String> |
errors |
protected long |
friendlyId |
protected String |
host_address |
protected ArrayList<String> |
messages |
protected org.apache.uima.ducc.cli.MonitorListener |
monitor_listener |
protected int |
returnCode |
protected boolean |
suppress_console_log |
protected Properties |
userSpecifiedProperties |
(package private) CountDownLatch |
waiter |
protected ArrayList<String> |
warnings |
Constructor and Description |
---|
CliBase() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
check_heap_size(String argsOption) |
(package private) boolean |
check_service_dependencies(String endpoint) |
(package private) void |
consoleExits() |
abstract boolean |
execute()
All extenders must implement execute - this method does whatever processing on the input
is needed and passes the CLI request to the internal DUCC processes.
|
(package private) boolean |
extractReply(org.apache.uima.ducc.transport.event.AbstractDuccOrchestratorEvent reply)
Extract messages and job pid from reply.
|
protected IDuccCallback |
getCallback() |
long |
getDuccId()
This returns the unique numeric id for the requested work.
|
(package private) String |
getLogDirectory(String working_directory) |
int |
getReturnCode()
This returns the return code from the execution of the requested work.
|
(package private) String |
getWorkingDirectory() |
protected void |
inhibitDefaults() |
protected void |
init(String myClassName,
org.apache.uima.ducc.cli.IUiOption[] uiOpts,
String[] args,
Properties props,
org.apache.uima.ducc.common.utils.DuccProperties cli_props,
IDuccCallback consoleCb,
String servlet) |
protected void |
init(String myClassName,
org.apache.uima.ducc.cli.IUiOptions.UiOption[] opts,
Properties props,
org.apache.uima.ducc.common.utils.DuccProperties cli_props,
IDuccCallback consoleCb) |
protected void |
init(String myClassName,
org.apache.uima.ducc.cli.IUiOptions.UiOption[] opts,
String[] args,
org.apache.uima.ducc.common.utils.DuccProperties cli_props,
IDuccCallback consoleCb) |
protected void |
initConsoleListener() |
boolean |
isConsoleAttached()
This is used to find if the remote console is redirected to the local process, and if so, is it still
active.
|
(package private) void |
message(String... e) |
(package private) void |
monitorExits(int rc) |
(package private) void |
saveSpec(String name,
org.apache.uima.ducc.common.utils.DuccProperties props) |
(package private) void |
setDefaults(org.apache.uima.ducc.cli.IUiOption[] uiOpts,
boolean suppress_console) |
(package private) void |
setOptions(org.apache.uima.ducc.cli.IUiOption[] uiOpts) |
boolean |
setProperty(String key,
String value)
Set a property via the API.
|
(package private) void |
setUser() |
protected void |
startConsoleListener(boolean start_stdin) |
protected void |
startMonitor(org.apache.uima.ducc.transport.event.IDuccContext.DuccContext context) |
protected void |
startMonitors(boolean start_stdin,
org.apache.uima.ducc.transport.event.IDuccContext.DuccContext context) |
protected void |
stopListeners() |
(package private) void |
usage(String message) |
boolean |
waitForCompletion()
Wait for the listeners - maybe a console listener, maybe a job listener, maybe both.
|
protected String ducc_home
protected org.apache.uima.ducc.transport.dispatcher.IDuccEventDispatcher dispatcher
protected org.apache.uima.ducc.cli.CommandLine commandLine
protected long friendlyId
protected int returnCode
protected org.apache.uima.ducc.common.utils.DuccProperties cli_props
protected boolean debug
protected org.apache.uima.ducc.cli.ConsoleListener console_listener
protected boolean suppress_console_log
protected String host_address
protected boolean console_attach
protected IDuccCallback consoleCb
protected org.apache.uima.ducc.cli.MonitorListener monitor_listener
CountDownLatch waiter
protected Properties userSpecifiedProperties
public abstract boolean execute() throws Exception
Exception
- The specific exception is a function of the implementor.protected void inhibitDefaults()
String getLogDirectory(String working_directory) throws IOException
IOException
String getWorkingDirectory() throws IOException
IOException
boolean check_service_dependencies(String endpoint)
void check_heap_size(String argsOption)
protected void init(String myClassName, org.apache.uima.ducc.cli.IUiOptions.UiOption[] opts, String[] args, org.apache.uima.ducc.common.utils.DuccProperties cli_props, IDuccCallback consoleCb) throws Exception
Exception
protected void init(String myClassName, org.apache.uima.ducc.cli.IUiOptions.UiOption[] opts, Properties props, org.apache.uima.ducc.common.utils.DuccProperties cli_props, IDuccCallback consoleCb) throws Exception
Exception
protected void init(String myClassName, org.apache.uima.ducc.cli.IUiOption[] uiOpts, String[] args, Properties props, org.apache.uima.ducc.common.utils.DuccProperties cli_props, IDuccCallback consoleCb, String servlet) throws Exception
myClassName
- Name of the class invoking me, for help stringuiOpts
- Array of IUioptions permitted for this commandargs
- Arguments from the command line (or null)props
- Properties passed in from the API (or null)cli_props
- (Initially) empty properties file to be filled inconsoleCb
- Console callback object (optional)servlet
- The name of the http servlet that will serve this requestException
- If initialization fails, e.g. invalid arguments or propertiesvoid setOptions(org.apache.uima.ducc.cli.IUiOption[] uiOpts) throws Exception
Exception
void setDefaults(org.apache.uima.ducc.cli.IUiOption[] uiOpts, boolean suppress_console) throws IOException
IOException
void saveSpec(String name, org.apache.uima.ducc.common.utils.DuccProperties props) throws Exception
Exception
boolean extractReply(org.apache.uima.ducc.transport.event.AbstractDuccOrchestratorEvent reply)
reply
- - an Orchestrator reply eventvoid usage(String message)
public boolean setProperty(String key, String value)
key
- This is the property name.value
- This is the value of the property.protected IDuccCallback getCallback()
void message(String... e)
public int getReturnCode()
public long getDuccId()
void consoleExits()
void monitorExits(int rc)
protected void startMonitors(boolean start_stdin, org.apache.uima.ducc.transport.event.IDuccContext.DuccContext context) throws Exception
Exception
protected void startMonitor(org.apache.uima.ducc.transport.event.IDuccContext.DuccContext context)
protected void startConsoleListener(boolean start_stdin) throws Exception
Exception
protected void stopListeners()
public boolean isConsoleAttached()
public boolean waitForCompletion()
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.