Class TailAdapterSpec
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,P>
org.springframework.integration.dsl.MessageProducerSpec<TailAdapterSpec,FileTailingMessageProducerSupport>
org.springframework.integration.file.dsl.TailAdapterSpec
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<FileTailingMessageProducerSupport>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
public class TailAdapterSpec extends MessageProducerSpec<TailAdapterSpec,FileTailingMessageProducerSupport>
A
MessageProducerSpec
for file tailing adapters.- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
PARSER, target
-
Constructor Summary
Constructors Modifier Constructor Description protected
TailAdapterSpec()
-
Method Summary
Modifier and Type Method Description TailAdapterSpec
autoStartup(boolean autoStartup)
TailAdapterSpec
delay(long delay)
The delay between checks of the file for new content in milliseconds.protected FileTailingMessageProducerSupport
doGet()
TailAdapterSpec
enableStatusReader(boolean enableStatusReader)
This field control the stderr events.TailAdapterSpec
end(boolean end)
Iftrue
, tail from the end of the file, otherwise include all lines from the beginning.TailAdapterSpec
errorChannel(MessageChannel errorChannel)
Configure theMessageChannel
to which error messages will be sent.protected TailAdapterSpec
file(File file)
TailAdapterSpec
fileDelay(long fileDelay)
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.TailAdapterSpec
id(String id)
Configure the component identifier.TailAdapterSpec
idleEventInterval(long idleEventInterval)
Specify the idle interval before start sending idle events.TailAdapterSpec
nativeOptions(String nativeOptions)
Specify the options string for nativetail
command.TailAdapterSpec
outputChannel(MessageChannel outputChannel)
Specify theoutputChannel
for theMessageProducer
TailAdapterSpec
phase(int phase)
TailAdapterSpec
reopen(boolean reopen)
Iftrue
, close and reopen the file between reading chunks.TailAdapterSpec
taskExecutor(TaskExecutor taskExecutor)
Configure a task executor.TailAdapterSpec
taskScheduler(TaskScheduler taskScheduler)
Set a task scheduler - defaults to the integration 'taskScheduler'.Methods inherited from class org.springframework.integration.dsl.MessageProducerSpec
errorChannel, errorMessageStrategy, outputChannel, sendTimeout, shouldTrack
Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Constructor Details
-
TailAdapterSpec
protected TailAdapterSpec()
-
-
Method Details
-
file
-
nativeOptions
Specify the options string for nativetail
command.- Parameters:
nativeOptions
- the nativeOptions.- Returns:
- the spec.
- See Also:
OSDelegatingFileTailingMessageProducer.setOptions(String)
-
enableStatusReader
This field control the stderr events.- Parameters:
enableStatusReader
- boolean to enable or disable events from stderr.- Returns:
- the spec
-
idleEventInterval
Specify the idle interval before start sending idle events.- Parameters:
idleEventInterval
- interval in ms for the event idle time.- Returns:
- the spec.
-
taskExecutor
Configure a task executor. Defaults to aSimpleAsyncTaskExecutor
.- Parameters:
taskExecutor
- the taskExecutor.- Returns:
- the spec.
-
taskScheduler
Set a task scheduler - defaults to the integration 'taskScheduler'.- Parameters:
taskScheduler
- the taskScheduler.- Returns:
- the spec.
-
delay
The delay between checks of the file for new content in milliseconds.- Parameters:
delay
- the delay.- Returns:
- the spec.
- See Also:
ApacheCommonsFileTailingMessageProducer.setPollingDelay(long)
-
fileDelay
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.- Parameters:
fileDelay
- the fileDelay.- Returns:
- the spec.
- See Also:
FileTailingMessageProducerSupport.setTailAttemptsDelay(long)
-
end
Iftrue
, tail from the end of the file, otherwise include all lines from the beginning. Defaulttrue
.- Parameters:
end
- the end.- Returns:
- the spec.
- See Also:
ApacheCommonsFileTailingMessageProducer.setEnd(boolean)
-
reopen
Iftrue
, close and reopen the file between reading chunks. Defaultfalse
.- Parameters:
reopen
- the reopen.- Returns:
- the spec.
- See Also:
ApacheCommonsFileTailingMessageProducer.setReopen(boolean)
-
id
Description copied from class:MessageProducerSpec
Configure the component identifier. Used as thebeanName
to register the bean in the application context for this component. Configure the message producer's bean name.- Overrides:
id
in classMessageProducerSpec<TailAdapterSpec,FileTailingMessageProducerSupport>
- Parameters:
id
- the id.- Returns:
- the spec.
-
phase
- Overrides:
phase
in classMessageProducerSpec<TailAdapterSpec,FileTailingMessageProducerSupport>
- Parameters:
phase
- the phase.- Returns:
- the spec.
- See Also:
SmartLifecycle
-
autoStartup
- Overrides:
autoStartup
in classMessageProducerSpec<TailAdapterSpec,FileTailingMessageProducerSupport>
- Parameters:
autoStartup
- the autoStartup.- Returns:
- the spec.
- See Also:
SmartLifecycle
-
outputChannel
Description copied from class:MessageProducerSpec
Specify theoutputChannel
for theMessageProducer
- Overrides:
outputChannel
in classMessageProducerSpec<TailAdapterSpec,FileTailingMessageProducerSupport>
- Parameters:
outputChannel
- the outputChannel.- Returns:
- the spec.
- See Also:
MessageProducerSupport.setOutputChannel(MessageChannel)
-
errorChannel
Description copied from class:MessageProducerSpec
Configure theMessageChannel
to which error messages will be sent.- Overrides:
errorChannel
in classMessageProducerSpec<TailAdapterSpec,FileTailingMessageProducerSupport>
- Parameters:
errorChannel
- the errorChannel.- Returns:
- the spec.
- See Also:
MessageProducerSupport.setErrorChannel(MessageChannel)
-
doGet
- Overrides:
doGet
in classIntegrationComponentSpec<TailAdapterSpec,FileTailingMessageProducerSupport>
-