public interface AttivioRunnable
AttivioRunnable subclasses should be written as standard java beans with get/set methods for all options. By default all bean
properties will be converted to command line options however ConfigurationOption
annotations can be added to the get methods to provide more information about the option. Currently only base data types plus
Lists and Maps are supported for command line argument generation and parsing. The CommandLineRunner
class is used to
invoke AttivioRunnables.
Implementations which wish to handle SIGINT (ctrl-c) must also implement AttivioStoppable
.
Example Code
public class MyRunnable implements AttivioRunnable { private String foo = null; private int count = 0; @Override public int run() throws AttivioException { System.err.println(foo + "=" + count); } @ConfigurationOption(required = true, description = "Foo value", shortOpt = "f") public String getFoo() { return foo; } public void setFoo(String newFoo) { foo = newFoo; } // automatically uses --count for command line option public int getCount() { return count; } public void setCount(int newCount) { count = newCount; } }
Modifier and Type | Field and Description |
---|---|
static String |
CREDENTIALS_ARG
the credentials argument
|
static String |
CREDENTIALS_DESCRIPTION
description for credentials
|
static int |
RETURN_CODE_ERROR
The return code to indicate an error occurred requiring shutdown.
|
static int |
RETURN_CODE_FORCED
The return code to indicate the user forced shutdown.
|
static int |
RETURN_CODE_OK
The return code to indicate normal shutdown occurred.
|
Modifier and Type | Method and Description |
---|---|
int |
run()
Perform logic and return one of
RETURN_CODE_OK , RETURN_CODE_ERROR . |
static final String CREDENTIALS_DESCRIPTION
static final String CREDENTIALS_ARG
static final int RETURN_CODE_OK
static final int RETURN_CODE_ERROR
static final int RETURN_CODE_FORCED
int run() throws AttivioException
RETURN_CODE_OK
, RETURN_CODE_ERROR
.AttivioException
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.