Top Description Inners Fields Constructors Methods
sun.nio.ch

pack-priv Class FileLockTable

extends Object
Class Inheritance
Imports
java.io.FileDescriptor, .IOException, java.lang.ref.ReferenceQueue, .WeakReference, java.nio.channels.Channel, .FileLock, .OverlappingFileLockException, java.util.ArrayList, .HashSet, .List, .Set, java.util.concurrent.ConcurrentHashMap

A file lock table that is over a system-wide map of all file locks.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
FileLockTable.FileLockReference

A weak reference to a FileLock.

Field Summary

Modifier and TypeField and Description
private final Channel
private final FileKey
private static final ConcurrentHashMap<FileKey, List<FileLockTable.FileLockReference>>
private final Set<FileLock>
private static final ReferenceQueue<FileLock>

Constructor Summary

AccessConstructor and Description
pack-priv
FileLockTable(Channel channel, FileDescriptor fd)

Creates a file lock table for a channel that is connected to the system-wide map of all file locks for the Java virtual machine.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
private void
checkList(List<FileLockTable.FileLockReference> list, long position, long size)

pack-priv void
pack-priv List<FileLock>
private void
private void
pack-priv void
replace(FileLock fromLock, FileLock toLock)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

channelback to summary
private final Channel channel
fileKeyback to summary
private final FileKey fileKey
lockMapback to summary
private static final ConcurrentHashMap<FileKey, List<FileLockTable.FileLockReference>> lockMap
locksback to summary
private final Set<FileLock> locks
queueback to summary
private static final ReferenceQueue<FileLock> queue

Constructor Detail

FileLockTableback to summary
pack-priv FileLockTable(Channel channel, FileDescriptor fd) throws IOException

Creates a file lock table for a channel that is connected to the system-wide map of all file locks for the Java virtual machine.

Method Detail

addback to summary
pack-priv void add(FileLock fl) throws OverlappingFileLockException
checkListback to summary
private void checkList(List<FileLockTable.FileLockReference> list, long position, long size) throws OverlappingFileLockException
removeback to summary
pack-priv void remove(FileLock fl)
removeAllback to summary
pack-priv List<FileLock> removeAll()
removeKeyIfEmptyback to summary
private void removeKeyIfEmpty(FileKey fk, List<FileLockTable.FileLockReference> list)
removeStaleEntriesback to summary
private void removeStaleEntries()
replaceback to summary
pack-priv void replace(FileLock fromLock, FileLock toLock)
sun.nio.ch back to summary

private Class FileLockTable.FileLockReference

extends WeakReference<FileLock>
Class Inheritance

A weak reference to a FileLock.

FileLockTable uses a list of file lock references to avoid keeping the FileLock (and FileChannel) alive.

Field Summary

Modifier and TypeField and Description
private final FileKey

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv FileKey

Field Detail

fileKeyback to summary
private final FileKey fileKey

Constructor Detail

FileLockReferenceback to summary
pack-priv FileLockReference(FileLock referent, ReferenceQueue<FileLock> queue, FileKey key)

Method Detail

fileKeyback to summary
pack-priv FileKey fileKey()