< prev index next >

src/jdk.unsupported/share/classes/com/sun/nio/file/SensitivityWatchEventModifier.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -24,10 +24,11 @@
  */
 
 package com.sun.nio.file;
 
 import java.nio.file.WatchEvent.Modifier;
+import sun.nio.fs.ExtendedOptions;
 
 /**
  * Defines the <em>sensitivity levels</em> when registering objects with a
  * watch service implementation that polls the file system.
  *

@@ -36,27 +37,29 @@
 
 public enum SensitivityWatchEventModifier implements Modifier {
     /**
      * High sensitivity.
      */
-    HIGH(2),
+    HIGH(ExtendedOptions.SENSITIVITY_HIGH, 2),
     /**
      * Medium sensitivity.
      */
-    MEDIUM(10),
+    MEDIUM(ExtendedOptions.SENSITIVITY_MEDIUM, 10),
     /**
      * Low sensitivity.
      */
-    LOW(30);
+    LOW(ExtendedOptions.SENSITIVITY_LOW, 30);
 
     /**
      * Returns the sensitivity in seconds.
      */
     public int sensitivityValueInSeconds() {
         return sensitivity;
     }
 
     private final int sensitivity;
-    private SensitivityWatchEventModifier(int sensitivity) {
+    private SensitivityWatchEventModifier(ExtendedOptions.InternalOption<Integer> option,
+                                          int sensitivity) {
         this.sensitivity = sensitivity;
+        option.register(this, sensitivity);
     }
 }
< prev index next >