public.javadoc.org.spincast.plugins.hotswap.fileswatcher.HotSwapFilesModificationsWatcherDefault.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
HotSwapFilesModificationsWatcherDefault (org.spincast:spincast-framework 1.0.0 API)
org.spincast.plugins.hotswap.fileswatcher
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
Modifier and Type
Field and Description
protected static org.slf4j.Logger
logger
-
Constructor Summary
Constructors
Constructor and Description
HotSwapFilesModificationsWatcherDefault(Set<HotSwapFilesModificationsListener> boundListeners)
-
Method Summary
-
-
Constructor Detail
-
HotSwapFilesModificationsWatcherDefault
@Inject
public HotSwapFilesModificationsWatcherDefault(@Nullable
Set<HotSwapFilesModificationsListener> boundListeners)
-
Method Detail
-
init
@Inject
public void init()
-
serverStartedSuccessfully
public void serverStartedSuccessfully()
Starts watching registered files when
the server is started.
- Specified by:
serverStartedSuccessfully
in interface ServerStartedListener
-
getListenersByDirAbsolutePaths
protected Map<String,Set<HotSwapFilesModificationsListener>> getListenersByDirAbsolutePaths()
-
getFileModificationsWatcherService
protected WatchService getFileModificationsWatcherService()
-
getListenersByWatchKey
protected Map<WatchKey,Set<HotSwapFilesModificationsListener>> getListenersByWatchKey()
-
createFileModificationsWatcherService
protected WatchService createFileModificationsWatcherService()
-
registerListener
public void registerListener(HotSwapFilesModificationsListener listener)
Description copied from interface: HotSwapFilesModificationsWatcher
Add a new listener for modifications to file(s)
to watch.
More than one listeners can be added for the same files!
- Specified by:
registerListener
in interface HotSwapFilesModificationsWatcher
-
removeAllListeners
public void removeAllListeners()
Description copied from interface: HotSwapFilesModificationsWatcher
Removes all listeners.
- Specified by:
removeAllListeners
in interface HotSwapFilesModificationsWatcher
-
removeListener
public void removeListener(HotSwapFilesModificationsListener listener)
Description copied from interface: HotSwapFilesModificationsWatcher
Removes a file modifications listener.
- Specified by:
removeListener
in interface HotSwapFilesModificationsWatcher
-
startFilesModificationsWatcher
protected void startFilesModificationsWatcher()
-
modifiedFileMatchs
protected boolean modifiedFileMatchs(File modifiedFile,
HotSwapFilesModificationsListener listener)
-
stopWatching
public void stopWatching()
Description copied from interface: HotSwapFilesModificationsWatcher
Stops the files watching completly.
Can't be restarted.
- Specified by:
stopWatching
in interface HotSwapFilesModificationsWatcher
Copyright © 2019. All rights reserved.