public abstract class FileTailingMessageProducerSupport extends MessageProducerSupport implements ApplicationEventPublisherAware
Modifier and Type | Class and Description |
---|---|
static class |
FileTailingMessageProducerSupport.FileTailingEvent |
static class |
FileTailingMessageProducerSupport.FileTailingIdleEvent |
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_TAIL_ATTEMPTS_DELAY
The default delay between tail attempts in milliseconds.
|
lifecycleCondition, lifecycleLock
EXPRESSION_PARSER, logger
DEFAULT_PHASE
Constructor and Description |
---|
FileTailingMessageProducerSupport() |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart()
Take no action by default.
|
protected void |
doStop()
Take no action by default.
|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected File |
getFile() |
protected long |
getMissingFileDelay() |
protected TaskExecutor |
getTaskExecutor() |
protected void |
publish(String message) |
protected void |
send(String line) |
void |
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) |
void |
setFile(File file)
The name of the file you wish to tail.
|
void |
setIdleEventInterval(long idleEventInterval)
How often to emit
FileTailingMessageProducerSupport.FileTailingIdleEvent s in milliseconds. |
void |
setTailAttemptsDelay(long tailAttemptsDelay)
The delay in milliseconds between attempts to tail a non-existent file,
or between attempts to execute a process if it fails for any reason.
|
void |
setTaskExecutor(TaskExecutor taskExecutor)
A task executor; default is a
SimpleAsyncTaskExecutor . |
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, onInit, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher
destroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBeanName, getComponentName
public static final long DEFAULT_TAIL_ATTEMPTS_DELAY
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher
in interface ApplicationEventPublisherAware
public void setFile(File file)
file
- The absolute path of the file.protected File getFile()
public void setTaskExecutor(TaskExecutor taskExecutor)
SimpleAsyncTaskExecutor
.taskExecutor
- The task executor.public void setTailAttemptsDelay(long tailAttemptsDelay)
tailAttemptsDelay
- the delay.public void setIdleEventInterval(long idleEventInterval)
FileTailingMessageProducerSupport.FileTailingIdleEvent
s in milliseconds.idleEventInterval
- the interval.protected long getMissingFileDelay()
protected TaskExecutor getTaskExecutor()
public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected void send(String line)
protected void publish(String message)
protected void doStart()
MessageProducerSupport
doStart
in class MessageProducerSupport
protected void doStop()
MessageProducerSupport
doStop
in class MessageProducerSupport