Spring Integration

org.springframework.integration.file.tail
Class OSDelegatingFileTailingMessageProducer

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.endpoint.AbstractEndpoint
          extended by org.springframework.integration.endpoint.MessageProducerSupport
              extended by org.springframework.integration.file.tail.FileTailingMessageProducerSupport
                  extended by org.springframework.integration.file.tail.OSDelegatingFileTailingMessageProducer
All Implemented Interfaces:
java.lang.Runnable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, NamedComponent, MessageProducer, TrackableComponent

public class OSDelegatingFileTailingMessageProducer
extends FileTailingMessageProducerSupport
implements java.lang.Runnable

A file tailing message producer that delegates to the OS tail program. This is likely the most efficient mechanism on platforms that support it. Default options are "-F -n 0" (follow file name, no existing records).

Since:
3.0
Author:
Gary Russell

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.integration.file.tail.FileTailingMessageProducerSupport
FileTailingMessageProducerSupport.FileTailingEvent
 
Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
OSDelegatingFileTailingMessageProducer()
           
 
Method Summary
protected  void doStart()
          Takes no action by default.
protected  void doStop()
          Takes no action by default.
 java.lang.String getComponentType()
          Subclasses may implement this method to provide component type information.
protected  void onInit()
          Subclasses may implement this for initialization logic.
 void run()
          Reads lines from stdout and sends in a message to the output channel.
 void setOptions(java.lang.String options)
           
 
Methods inherited from class org.springframework.integration.file.tail.FileTailingMessageProducerSupport
getFile, getMissingFileDelay, getTaskExecutor, publish, send, setApplicationEventPublisher, setFile, setTailAttemptsDelay, setTaskExecutor
 
Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
sendMessage, setErrorChannel, setOutputChannel, setSendTimeout, setShouldTrack
 
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.integration.context.NamedComponent
getComponentName
 

Constructor Detail

OSDelegatingFileTailingMessageProducer

public OSDelegatingFileTailingMessageProducer()
Method Detail

setOptions

public void setOptions(java.lang.String options)

getComponentType

public java.lang.String getComponentType()
Description copied from class: IntegrationObjectSupport
Subclasses may implement this method to provide component type information.

Specified by:
getComponentType in interface NamedComponent
Overrides:
getComponentType in class FileTailingMessageProducerSupport

onInit

protected void onInit()
Description copied from class: IntegrationObjectSupport
Subclasses may implement this for initialization logic.

Overrides:
onInit in class MessageProducerSupport

doStart

protected void doStart()
Description copied from class: MessageProducerSupport
Takes no action by default. Subclasses may override this if they need lifecycle-managed behavior.

Overrides:
doStart in class MessageProducerSupport

doStop

protected void doStop()
Description copied from class: MessageProducerSupport
Takes no action by default. Subclasses may override this if they need lifecycle-managed behavior.

Overrides:
doStop in class MessageProducerSupport

run

public void run()
Reads lines from stdout and sends in a message to the output channel.

Specified by:
run in interface java.lang.Runnable

Spring Integration