org.springframework.integration.adapter.file
Class Backlog<T>

java.lang.Object
  extended by org.springframework.integration.adapter.file.Backlog<T>

public class Backlog<T>
extends java.lang.Object

Tracks changes in a collection. This implementation is thread-safe as it allows to synchronously process a new directory structure.

Author:
Marius Bogoevici, Mark Fisher, Iwein Fuld

Field Summary
private  java.util.Map<java.lang.String,T> backlog
           
private  org.apache.commons.logging.Log logger
           
private  java.util.Map<java.lang.String,T> previousSnapshot
           
private  java.lang.ThreadLocal<java.util.Map<java.lang.String,T>> processingBuffer
          This is the storage for backlog that is being processed by a specific thread.
 
Constructor Summary
Backlog()
           
 
Method Summary
 void fileProcessed(java.lang.String... keys)
           
 java.util.Map<java.lang.String,T> getBacklog()
           
 java.util.Map<java.lang.String,T> getProcessingBuffer()
           
 void itemProcessing(java.lang.String... keys)
           
 void processingFailed()
           
 void processSnapshot(java.util.Map<java.lang.String,T> currentSnapshot)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private final org.apache.commons.logging.Log logger

previousSnapshot

private java.util.Map<java.lang.String,T> previousSnapshot

backlog

private final java.util.Map<java.lang.String,T> backlog

processingBuffer

private java.lang.ThreadLocal<java.util.Map<java.lang.String,T>> processingBuffer
This is the storage for backlog that is being processed by a specific thread. Not initialized means that we're not in thread safe mode (just working directly on the backlog)

Constructor Detail

Backlog

public Backlog()
Method Detail

processSnapshot

public void processSnapshot(java.util.Map<java.lang.String,T> currentSnapshot)

itemProcessing

public void itemProcessing(java.lang.String... keys)

processingFailed

public void processingFailed()

fileProcessed

public void fileProcessed(java.lang.String... keys)

getBacklog

public java.util.Map<java.lang.String,T> getBacklog()

getProcessingBuffer

public java.util.Map<java.lang.String,T> getProcessingBuffer()