Class StandardFileWatchService

  • All Implemented Interfaces:
    FileWatchService, java.lang.AutoCloseable

    public class StandardFileWatchService
    extends java.lang.Object
    implements FileWatchService, java.lang.AutoCloseable
    Standard FileWatchService implementation based on JDK 7 WatchService
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    WatchService
    • Field Detail

      • DEFAULT_THREAD_NAME_PREFIX

        public static final java.lang.String DEFAULT_THREAD_NAME_PREFIX
        The default thread name prefix : "microsphere-file-watch-service"
        See Also:
        Constant Field Values
      • THREAD_NAME_PREFIX_PROPERTY_NAME

        public static final java.lang.String THREAD_NAME_PREFIX_PROPERTY_NAME
        The thread name prefix property name : "microsphere.file-watch-service.thread-name-prefix
        See Also:
        Constant Field Values
      • THREAD_NAME_PREFIX

        public static final java.lang.String THREAD_NAME_PREFIX
        The thread name prefix , default value : "microsphere-file-watch-service-"
    • Constructor Detail

      • StandardFileWatchService

        public StandardFileWatchService()
      • StandardFileWatchService

        public StandardFileWatchService​(java.util.concurrent.Executor eventHandlerExecutor)
      • StandardFileWatchService

        public StandardFileWatchService​(java.util.concurrent.Executor eventHandlerExecutor,
                                        java.util.concurrent.ExecutorService eventLoopExecutor)
    • Method Detail

      • start

        public void start()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • stop

        public void stop()
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception