Class WatchServiceListener.Builder
java.lang.Object
ninja.leaping.configurate.reference.WatchServiceListener.Builder
- Enclosing class:
- WatchServiceListener
public static class WatchServiceListener.Builder extends Object
Set the parameters needed to create a
WatchServiceListener
. All params are optional and defaults will be
used if no values are specified.-
Method Summary
Modifier and Type Method Description WatchServiceListener
build()
Create a new listener, using default values for any unset parameters.WatchServiceListener.Builder
setFileSystem(FileSystem system)
Set the filesystem expected to be used for paths.WatchServiceListener.Builder
setTaskExecutor(Executor executor)
Set the executor that will be used to execute tasks queued based on received events.WatchServiceListener.Builder
setThreadFactory(ThreadFactory factory)
Set the thread factory that will be used to create the polling thread for this watch service
-
Method Details
-
setThreadFactory
Set the thread factory that will be used to create the polling thread for this watch service- Parameters:
factory
- The thread factory to create the deamon thread- Returns:
- this
-
setTaskExecutor
Set the executor that will be used to execute tasks queued based on received events. By default, thecommon pool
is used.- Parameters:
executor
- The executor to use- Returns:
- this
-
setFileSystem
Set the filesystem expected to be used for paths. A separateWatchServiceListener
should be created to listen to events on a different file system.- Parameters:
system
- The file system to use.- Returns:
- this
-
build
Create a new listener, using default values for any unset parameters.- Returns:
- A newly created executor
- Throws:
IOException
- if thrown byWatchServiceListener
's constructor
-