| |
|
| java.lang.Object org.geotools.data.shapefile.Lock
Lock | public class Lock (Code) | | A read-write lock for shapefiles so that OS file locking exceptions will not
ruin an attempt to update a shapefile. On windows there are often operating
system locking conflicts when writing to a shapefile. In order to not have
exceptions thrown everytime a write is made, geotools has implemented file
locking for shapefiles.
author: jeichar |
Method Summary | |
synchronized boolean | canRead() | synchronized boolean | canWrite() | synchronized int | getReadLocks(Thread thread) | public synchronized void | lockRead() Called by shapefileReader before a read is started and before an IOStream
is openned. | public synchronized void | lockWrite() Called by ShapefileDataStore before a write is started and before an
IOStream is openned. | synchronized boolean | ownWriteLock(Thread thread) | public synchronized void | unlockRead() Called by ShapefileReader after a read is complete and after the IOStream
is closed. | public synchronized void | unlockWrite() |
owners | Map owners(Code) | | Thread->Owner map. If empty no read locks exist.
|
writeLocks | int writeLocks(Code) | | indicates a write is occurring
|
writer | Thread writer(Code) | | if not null a writer is waiting for the lock or is writing.
|
canRead | synchronized boolean canRead() throws IOException(Code) | | If the lock can be read locked the lock will be read and default
visibility for tests
throws: IOException - |
canWrite | synchronized boolean canWrite() throws IOException(Code) | | If the lock can be read locked the lock will be read and default
visibility for tests
throws: IOException - |
getReadLocks | synchronized int getReadLocks(Thread thread)(Code) | | default visibility for tests
|
lockRead | public synchronized void lockRead() throws IOException(Code) | | Called by shapefileReader before a read is started and before an IOStream
is openned.
throws: IOException - |
lockWrite | public synchronized void lockWrite() throws IOException(Code) | | Called by ShapefileDataStore before a write is started and before an
IOStream is openned.
throws: IOException - |
ownWriteLock | synchronized boolean ownWriteLock(Thread thread)(Code) | | default visibility for tests
|
unlockRead | public synchronized void unlockRead()(Code) | | Called by ShapefileReader after a read is complete and after the IOStream
is closed.
|
unlockWrite | public synchronized void unlockWrite()(Code) | | |
|
|
|