SFMF4J's Architecture

SFMF4J's architecture was inspired by the widely popular logging library SLF4J (and its name was chosen as a tribute). This design does a good job of separating APIs from their implementations. It allows library developers to focus on what actions should be taken when a file system event has occurred, and defers the responsibility of choosing an implementation to the application developer.

FileMonitorServiceFactory

A FileMonitorServiceFactory is responsible for creating and configuring FileMonitorService instances. It is provided by the SFMF4J implementation library.

FileMonitorService

A FileMonitorService is responsible for monitoring the file system and notifying interested parties of change events. It is provided by the SFMF4J implementation library.

DirectoryListener

A DirectoryListener implements callback methods for handling file system events. The DirectoryListener interface is supplied by sfmf4j-api (along with a no-op implementation, DirectoryListenerAdapter). It must be implemented in your own code.