jdk/src/share/classes/java/nio/channels/FileLock.java
changeset 3631 4dc04372d56b
parent 2057 3acf8e5e2ca0
child 5506 202f599c92aa
equal deleted inserted replaced
3629:6035eed86b12 3631:4dc04372d56b
   112  *
   112  *
   113  *
   113  *
   114  * @author Mark Reinhold
   114  * @author Mark Reinhold
   115  * @author JSR-51 Expert Group
   115  * @author JSR-51 Expert Group
   116  * @since 1.4
   116  * @since 1.4
   117  * @updated 1.7
       
   118  */
   117  */
   119 
   118 
   120 public abstract class FileLock {
   119 public abstract class FileLock {
   121 
   120 
   122     private final Channel channel;
   121     private final Channel channel;
   159         this.size = size;
   158         this.size = size;
   160         this.shared = shared;
   159         this.shared = shared;
   161     }
   160     }
   162 
   161 
   163     /**
   162     /**
   164      * {@note new} Initializes a new instance of this class.
   163      * Initializes a new instance of this class.
   165      *
   164      *
   166      * @param  channel
   165      * @param  channel
   167      *         The channel upon whose file this lock is held
   166      *         The channel upon whose file this lock is held
   168      *
   167      *
   169      * @param  position
   168      * @param  position
   197         this.size = size;
   196         this.size = size;
   198         this.shared = shared;
   197         this.shared = shared;
   199     }
   198     }
   200 
   199 
   201     /**
   200     /**
   202      * {@note revised}
       
   203      * Returns the file channel upon whose file this lock was acquired.
   201      * Returns the file channel upon whose file this lock was acquired.
   204      *
   202      *
   205      * <p> This method has been superseded by the {@link #acquiredBy acquiredBy}
   203      * <p> This method has been superseded by the {@link #acquiredBy acquiredBy}
   206      * method.
   204      * method.
   207      *
   205      *
   211     public final FileChannel channel() {
   209     public final FileChannel channel() {
   212         return (channel instanceof FileChannel) ? (FileChannel)channel : null;
   210         return (channel instanceof FileChannel) ? (FileChannel)channel : null;
   213     }
   211     }
   214 
   212 
   215     /**
   213     /**
   216      * {@note new}
       
   217      * Returns the channel upon whose file this lock was acquired.
   214      * Returns the channel upon whose file this lock was acquired.
   218      *
   215      *
   219      * @return  The channel upon whose file this lock was acquired.
   216      * @return  The channel upon whose file this lock was acquired.
   220      *
   217      *
   221      * @since 1.7
   218      * @since 1.7