public class ApacheCommonsFileTailingMessageProducer extends FileTailingMessageProducerSupport implements org.apache.commons.io.input.TailerListener
FileTailingMessageProducerSupport.FileTailingEvent, FileTailingMessageProducerSupport.FileTailingIdleEvent
DEFAULT_TAIL_ATTEMPTS_DELAY
lifecycleCondition, lifecycleLock
EXPRESSION_PARSER, logger
DEFAULT_PHASE
Constructor and Description |
---|
ApacheCommonsFileTailingMessageProducer() |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart()
Take no action by default.
|
protected void |
doStop()
Take no action by default.
|
void |
fileNotFound() |
void |
fileRotated() |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
void |
handle(Exception ex) |
void |
handle(String line) |
void |
init(org.apache.commons.io.input.Tailer tailer) |
void |
setEnd(boolean end)
If true, tail from the end of the file, otherwise
include all lines from the beginning.
|
void |
setPollingDelay(long pollingDelay)
The delay between checks of the file for new content in milliseconds.
|
void |
setReopen(boolean reopen)
If true, close and reopen the file between reading chunks;
default false.
|
getFile, getMissingFileDelay, getTaskExecutor, publish, send, setApplicationEventPublisher, setFile, setIdleEventInterval, setTailAttemptsDelay, setTaskExecutor
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, onInit, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher
destroy, doStop, getPhase, getRole, 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 ApacheCommonsFileTailingMessageProducer()
public void setPollingDelay(long pollingDelay)
pollingDelay
- The delay.public void setEnd(boolean end)
end
- true or falsepublic void setReopen(boolean reopen)
reopen
- true or false.public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class FileTailingMessageProducerSupport
protected void doStart()
MessageProducerSupport
doStart
in class FileTailingMessageProducerSupport
protected void doStop()
MessageProducerSupport
doStop
in class FileTailingMessageProducerSupport
public void init(org.apache.commons.io.input.Tailer tailer)
init
in interface org.apache.commons.io.input.TailerListener
public void fileNotFound()
fileNotFound
in interface org.apache.commons.io.input.TailerListener
public void fileRotated()
fileRotated
in interface org.apache.commons.io.input.TailerListener
public void handle(String line)
handle
in interface org.apache.commons.io.input.TailerListener
public void handle(Exception ex)
handle
in interface org.apache.commons.io.input.TailerListener