Lines Matching refs:lock

67  *   <li><p> A region of a file may be {@link #lock <i>locked</i>} against
388 * Acquires a lock on the given region of this channel's file.
390 * <p> This method initiates an operation to acquire a lock on the given
392 * completion handler that is invoked when the lock is acquired (or the
400 * region then the new portion of the file will not be covered by the lock.
401 * If a file is expected to grow in size and a lock on the entire file is
404 * {@link #lock(Object,CompletionHandler)} method simply locks a region
405 * of size {@link Long#MAX_VALUE}. If a lock that overlaps the requested
407 * been invoked to lock an overlapping region and that operation has not
411 * lock in an asynchronous manner. Consequently an implementation may
412 * acquire the file lock in a background thread or from a task executed by
413 * a thread in the associated thread pool. If there are many lock operations
418 * request for a shared lock is automatically converted into a request for
419 * an exclusive lock. Whether the newly-acquired lock is shared or
420 * exclusive may be tested by invoking the resulting lock object's {@link
434 * {@code true} to request a shared lock, in which case this
436 * {@code false} to request an exclusive lock, in which case this
444 * If a lock that overlaps the requested region is already held by
446 * to lock an overlapping region
454 public abstract <A> void lock(long position,
461 * Acquires an exclusive lock on this channel's file.
463 * <p> This method initiates an operation to acquire a lock on the given
465 * completion handler that is invoked when the lock is acquired (or the
469 * <p> An invocation of this method of the form {@code ch.lock(att,handler)}
472 * ch.{@link #lock(long,long,boolean,Object,CompletionHandler) lock}(0L, Long.MAX_VALUE, false, att, handler)
481 * If a lock is already held by this Java virtual machine, or there
482 * is already a pending attempt to lock a region
486 public final <A> void lock(A attachment,
489 lock(0L, Long.MAX_VALUE, false, attachment, handler);
493 * Acquires a lock on the given region of this channel's file.
495 * <p> This method initiates an operation to acquire a lock on the given
497 * manner as the {@link #lock(long, long, boolean, Object, CompletionHandler)}
510 * {@code true} to request a shared lock, in which case this
512 * {@code false} to request an exclusive lock, in which case this
518 * If a lock is already held by this Java virtual machine, or there
519 * is already a pending attempt to lock a region
527 public abstract Future<FileLock> lock(long position, long size, boolean shared);
530 * Acquires an exclusive lock on this channel's file.
532 * <p> This method initiates an operation to acquire an exclusive lock on this
540 * ch.{@link #lock(long,long,boolean) lock}(0L, Long.MAX_VALUE, false)
546 * If a lock is already held by this Java virtual machine, or there
547 * is already a pending attempt to lock a region
551 public final Future<FileLock> lock() {
552 return lock(0L, Long.MAX_VALUE, false);
556 * Attempts to acquire a lock on the given region of this channel's file.
559 * either having acquired a lock on the requested region or having failed to
560 * do so. If it fails to acquire a lock because an overlapping lock is held
562 * a lock for any other reason then an appropriate exception is thrown.
573 * {@code true} to request a shared lock,
574 * {@code false} to request an exclusive lock
576 * @return A lock object representing the newly-acquired lock,
577 * or {@code null} if the lock could not be acquired
578 * because another program holds an overlapping lock
585 * If a lock that overlaps the requested region is already held by
587 * blocked in this method and is attempting to lock an overlapping
597 * @see #lock(Object,CompletionHandler)
598 * @see #lock(long,long,boolean,Object,CompletionHandler)
605 * Attempts to acquire an exclusive lock on this channel's file.
613 * @return A lock object representing the newly-acquired lock,
614 * or {@code null} if the lock could not be acquired
615 * because another program holds an overlapping lock
620 * If a lock that overlaps the requested region is already held by
622 * blocked in this method and is attempting to lock an overlapping
630 * @see #lock(Object,CompletionHandler)
631 * @see #lock(long,long,boolean,Object,CompletionHandler)