|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.context.IntegrationObjectSupport org.springframework.integration.file.monitors.AbstractEventDrivenFileMonitor
public abstract class AbstractEventDrivenFileMonitor
This component will support event-based (not poller based) notifications of files from a file system. Immediate implementations will center around supporting other adapters's delivery of files once they've been synced from a remote system. Potential future expansions for consumer consumption might be a push / event-based file adapter based on either native code or Java 7's NIO.2 WaterService or other third party implementations.
In the meantime, this provides us with a base class for building event driven file adapters quickly. The two cases I see are:
Field Summary |
---|
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
AbstractEventDrivenFileMonitor()
|
Method Summary | |
---|---|
protected void |
installDirectoryIfRequired(java.io.File directoryToMonitor)
Handles ensuring that the directory we're monitroring exists or can be created |
void |
monitor(java.io.File directory,
FileAdditionListener fileAdditionListener)
installs directory, and then kicks of an event pump |
protected void |
onInit()
Subclasses may implement this for initialization logic. |
protected void |
prescan()
Obviously, we're trying to keep away from scanning, but this may be necessary at startup to catch up the backlog |
protected void |
publishNewFileReceived(java.io.File file)
|
protected void |
publishNewFileReceived(java.lang.String path)
|
void |
setAutoCreateDirectory(boolean autoCreateDirectory)
|
void |
setExecutor(java.util.concurrent.Executor executor)
|
void |
setFilter(EntryListFilter<java.io.File> filter)
|
void |
setMaxQueueSize(int maxQueueSize)
|
void |
setScanDirectoryOnLoad(boolean scanDirectoryOnLoad)
|
protected void |
start()
Custom initialization hook - override at your discretion |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractEventDrivenFileMonitor()
Method Detail |
---|
public void setScanDirectoryOnLoad(boolean scanDirectoryOnLoad)
public void monitor(java.io.File directory, FileAdditionListener fileAdditionListener) throws java.lang.Exception
monitor
in interface EventDrivenDirectoryMonitor
directory
- the directory to start watching from. Unspecified if this implies recursion or not.fileAdditionListener
- the callback
java.lang.Exception
public void setMaxQueueSize(int maxQueueSize)
public void setFilter(EntryListFilter<java.io.File> filter)
public void setExecutor(java.util.concurrent.Executor executor)
public void setAutoCreateDirectory(boolean autoCreateDirectory)
protected void publishNewFileReceived(java.lang.String path)
protected void publishNewFileReceived(java.io.File file)
protected void prescan()
protected void installDirectoryIfRequired(java.io.File directoryToMonitor) throws java.lang.Exception
directoryToMonitor
- the directory to monitor
java.lang.Exception
protected void start() throws java.lang.Exception
java.lang.Exception
protected void onInit() throws java.lang.Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |