|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.impl.DefaultEndpoint org.apache.camel.component.exec.ExecEndpoint
public class ExecEndpoint
The endpoint utilizes an ExecCommandExecutor
to execute a system
command when it receives message exchanges.
ExecBinding
,
ExecCommandExecutor
,
ExecCommand
,
ExecResult
Field Summary | |
---|---|
static long |
NO_TIMEOUT
Indicates that no timeout is used. |
Constructor Summary | |
---|---|
ExecEndpoint(String uri,
ExecComponent component)
|
Method Summary | |
---|---|
Consumer |
createConsumer(Processor processor)
|
Producer |
createProducer()
|
String |
getArgs()
The arguments may be one or many whitespace-separated tokens, that can be quoted with ", e.g. |
ExecBinding |
getBinding()
|
ExecCommandExecutor |
getCommandExecutor()
|
String |
getExecutable()
|
String |
getOutFile()
|
long |
getTimeout()
|
String |
getWorkingDir()
|
boolean |
isSingleton()
|
boolean |
isUseStderrOnEmptyStdout()
|
void |
setArgs(String args)
Sets the arguments of the executable application |
void |
setBinding(ExecBinding binding)
|
void |
setCommandExecutor(ExecCommandExecutor commandExecutor)
Sets a custom executor to execute commands. |
void |
setExecutable(String executable)
Sets the executable to be executed. |
void |
setOutFile(String outFile)
|
void |
setTimeout(long timeout)
Sets the timeout. |
void |
setUseStderrOnEmptyStdout(boolean useStderrOnEmptyStdout)
|
void |
setWorkingDir(String dir)
Sets the working directory of the executable. |
Methods inherited from class org.apache.camel.impl.DefaultEndpoint |
---|
configureProperties, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExchangePattern, getExchangeType, hashCode, isLenientProperties, setCamelContext, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long NO_TIMEOUT
timeout
is used.
Constructor Detail |
---|
public ExecEndpoint(String uri, ExecComponent component)
Method Detail |
---|
public Producer createProducer() throws Exception
Exception
public Consumer createConsumer(Processor processor) throws Exception
Exception
public boolean isSingleton()
public String getExecutable()
ExecBinding.EXEC_COMMAND_EXECUTABLE
public void setExecutable(String executable)
null
.
executable
- Sets the executable to be executed.public String getArgs()
args="arg 1" arg2"
will use two arguments
arg 1
and arg2
. To include the quotes use
""
args=""arg 1"" arg2
will use the arguments
"arg 1"
and arg2
.
ExecBinding.EXEC_COMMAND_ARGS
,
ExecParseUtils.splitToWhiteSpaceSeparatedTokens(String)
public void setArgs(String args)
args
- Returns null
value if no arguments are
configured in the endpoint URIgetArgs()
,
ExecBinding.EXEC_COMMAND_ARGS
public String getWorkingDir()
null
is
such is not set.ExecBinding.EXEC_COMMAND_WORKING_DIR
public void setWorkingDir(String dir)
dir
- the working directory of the executable. null
values indicates that the current working directory will be
used.public long getTimeout()
long
. The
default value is NO_TIMEOUT
ExecBinding.EXEC_COMMAND_TIMEOUT
public void setTimeout(long timeout)
timeout
- The timeout
must be a positive longExecBinding.EXEC_COMMAND_TIMEOUT
public String getOutFile()
null
if no out file is set, otherwise returns the
value of the outFileExecBinding.EXEC_COMMAND_OUT_FILE
public void setOutFile(String outFile)
outFile
- a not-empty file pathExecBinding.EXEC_COMMAND_OUT_FILE
public ExecCommandExecutor getCommandExecutor()
DefaultExecCommandExecutor
public void setCommandExecutor(ExecCommandExecutor commandExecutor)
commandExecutor
- a not-null instance of ExecCommandExecutor
public ExecBinding getBinding()
public void setBinding(ExecBinding binding)
public boolean isUseStderrOnEmptyStdout()
public void setUseStderrOnEmptyStdout(boolean useStderrOnEmptyStdout)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |