public class ExecEndpoint
extends org.apache.camel.impl.DefaultEndpoint
ExecCommandExecutor to execute a system
command when it receives message exchanges.ExecBinding,
ExecCommandExecutor,
ExecCommand,
ExecResult| Modifier and Type | Field and Description |
|---|---|
static long |
NO_TIMEOUT
Indicates that no
timeout is used. |
| Constructor and Description |
|---|
ExecEndpoint(String uri,
ExecComponent component) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
org.apache.camel.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.
|
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, getPollingConsumerQueueSize, hashCode, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toStringdoResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspendpublic static final long NO_TIMEOUT
timeout is used.public ExecEndpoint(String uri, ExecComponent component)
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
throws Exception
Exceptionpublic boolean isSingleton()
public String getExecutable()
ExecBinding.EXEC_COMMAND_EXECUTABLEpublic 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_ARGSpublic String getWorkingDir()
null is
such is not set.ExecBinding.EXEC_COMMAND_WORKING_DIRpublic 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_TIMEOUTExecBinding.EXEC_COMMAND_TIMEOUTpublic void setTimeout(long timeout)
timeout - The timeout must be a positive longExecBinding.EXEC_COMMAND_TIMEOUTpublic String getOutFile()
null if no out file is set, otherwise returns the
value of the outFileExecBinding.EXEC_COMMAND_OUT_FILEpublic void setOutFile(String outFile)
outFile - a not-empty file pathExecBinding.EXEC_COMMAND_OUT_FILEpublic ExecCommandExecutor getCommandExecutor()
DefaultExecCommandExecutorpublic void setCommandExecutor(ExecCommandExecutor commandExecutor)
commandExecutor - a not-null instance of ExecCommandExecutorpublic ExecBinding getBinding()
public void setBinding(ExecBinding binding)
public boolean isUseStderrOnEmptyStdout()
public void setUseStderrOnEmptyStdout(boolean useStderrOnEmptyStdout)
Apache Camel