|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.adapter.file.AbstractDirectorySource
public abstract class AbstractDirectorySource
Base class for implementing a Source that creates messages from files in a directory, either local or remote.
Field Summary | |
---|---|
private DirectoryContentManager |
directoryContentManager
|
static java.lang.String |
FILE_INFO_PROPERTY
|
private org.apache.commons.logging.Log |
logger
|
private MessageCreator<java.io.File,?> |
messageCreator
|
Constructor Summary | |
---|---|
AbstractDirectorySource(MessageCreator<java.io.File,?> messageCreator)
|
Method Summary | |
---|---|
protected abstract void |
disconnect()
Disconnects from the directory |
protected abstract void |
establishConnection()
Connects to the directory, if necessary. |
protected DirectoryContentManager |
getDirectoryContentManager()
|
MessageCreator<java.io.File,?> |
getMessageCreator()
|
void |
onFailure(MessagingException exception)
Callback method invoked after a message delivery failure. |
void |
onSend(Message<?> message)
Callback method invoked after a message is sent successfully. |
protected abstract void |
populateSnapshot(java.util.Map<java.lang.String,FileInfo> snapshot)
Constructs the snapshot by iterating files. |
Message |
receive()
Retrieve a message from this source or null if no message is available. |
protected abstract java.io.File |
retrieveNextFile()
Returns the next file, based on the backlog data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILE_INFO_PROPERTY
private final org.apache.commons.logging.Log logger
private final DirectoryContentManager directoryContentManager
private final MessageCreator<java.io.File,?> messageCreator
Constructor Detail |
---|
public AbstractDirectorySource(MessageCreator<java.io.File,?> messageCreator)
Method Detail |
---|
protected DirectoryContentManager getDirectoryContentManager()
public MessageCreator<java.io.File,?> getMessageCreator()
public final Message receive()
MessageSource
null
if no message is available.
receive
in interface MessageSource<java.lang.Object>
public void onSend(Message<?> message)
MessageDeliveryAware
onSend
in interface MessageDeliveryAware
public void onFailure(MessagingException exception)
MessageDeliveryAware
onFailure
in interface MessageDeliveryAware
protected abstract void establishConnection() throws java.io.IOException
java.io.IOException
protected abstract void populateSnapshot(java.util.Map<java.lang.String,FileInfo> snapshot) throws java.io.IOException
snapshot
-
java.io.IOException
protected abstract java.io.File retrieveNextFile() throws java.io.IOException
java.io.IOException
protected abstract void disconnect()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |