Class HotSwapFilesModificationsWatcherDefault
java.lang.Object
org.spincast.plugins.hotswap.fileswatcher.HotSwapFilesModificationsWatcherDefault
- All Implemented Interfaces:
ServerStartedListener,HotSwapFilesModificationsWatcher
public class HotSwapFilesModificationsWatcherDefault
extends Object
implements HotSwapFilesModificationsWatcher
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHotSwapFilesModificationsWatcherDefault(Set<HotSwapFilesModificationsListener> boundListeners) -
Method Summary
Modifier and TypeMethodDescriptionprotected WatchServiceprotected WatchServiceprotected Map<String,Set<HotSwapFilesModificationsListener>> protected Map<WatchKey,Set<HotSwapFilesModificationsListener>> voidinit()protected booleanmodifiedFileMatchs(File modifiedFile, HotSwapFilesModificationsListener listener) voidAdd a new listener for modifications to file(s) to watch.voidRemoves all listeners.voidRemoves a file modifications listener.voidStarts watching registered files when the server is started.protected voidvoidStops the files watching completly.
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
HotSwapFilesModificationsWatcherDefault
@Inject public HotSwapFilesModificationsWatcherDefault(@Nullable Set<HotSwapFilesModificationsListener> boundListeners)
-
-
Method Details
-
init
@Inject public void init() -
serverStartedSuccessfully
public void serverStartedSuccessfully()Starts watching registered files when the server is started.- Specified by:
serverStartedSuccessfullyin interfaceServerStartedListener
-
getListenersByDirAbsolutePaths
-
getWatchKeysByDirAbsolutePaths
-
getDirAbsolutePathsByWatchKey
-
getFileModificationsWatcherService
-
getListenersByWatchKey
-
createFileModificationsWatcherService
-
registerListener
Description copied from interface:HotSwapFilesModificationsWatcherAdd a new listener for modifications to file(s) to watch.More than one listeners can be added for the same files!
- Specified by:
registerListenerin interfaceHotSwapFilesModificationsWatcher
-
removeAllListeners
public void removeAllListeners()Description copied from interface:HotSwapFilesModificationsWatcherRemoves all listeners.- Specified by:
removeAllListenersin interfaceHotSwapFilesModificationsWatcher
-
removeListener
Description copied from interface:HotSwapFilesModificationsWatcherRemoves a file modifications listener.- Specified by:
removeListenerin interfaceHotSwapFilesModificationsWatcher
-
startFilesModificationsWatcher
protected void startFilesModificationsWatcher() -
modifiedFileMatchs
-
stopWatching
public void stopWatching()Description copied from interface:HotSwapFilesModificationsWatcherStops the files watching completly. Can't be restarted.- Specified by:
stopWatchingin interfaceHotSwapFilesModificationsWatcher
-