Class WatchServiceListener.Builder
java.lang.Object
org.spongepowered.configurate.reference.WatchServiceListener.Builder
- Enclosing class:
- WatchServiceListener
Set the parameters needed to create a
WatchServiceListener
. All params are optional and defaults will be
used if no values are specified.- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create a new listener, using default values for any unset parameters.fileSystem
(FileSystem system) Set the filesystem expected to be used for paths.taskExecutor
(Executor executor) Set the executor that will be used to execute tasks queued based on received events.threadFactory
(ThreadFactory factory) Set the thread factory that will be used to create the polling thread for the returned watch service.
-
Method Details
-
threadFactory
Set the thread factory that will be used to create the polling thread for the returned watch service.- Parameters:
factory
- the thread factory to use to create the deamon thread- Returns:
- this builder
- Since:
- 4.0.0
-
taskExecutor
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 builder
- Since:
- 4.0.0
-
fileSystem
Set the filesystem expected to be used for paths. A separateWatchServiceListener
should be created to listen to events on each different file system.- Parameters:
system
- the file system to use.- Returns:
- this builder
- Since:
- 4.0.0
-
build
Create a new listener, using default values for any unset parameters.- Returns:
- a newly created executor
- Throws:
IOException
- if thrown byWatchServiceListener
's constructor- Since:
- 4.0.0
-