org.geotools.data
Class DefaultFeatureLock

Object
  extended by DefaultFeatureLock
All Implemented Interfaces:
FeatureLock

public class DefaultFeatureLock
extends Object
implements FeatureLock

Used to lock features when used with LockingDataSource.

This class is responsible for supplying a unique Authorization ID and expirery date for LockingDataSource locking operations.

Example:
 FeatureLock lock1 = FeatureLockFactory.generate( 18*60*60 ); // expire in 18 min
 FeatureLock lock3 = FeatureLockFactory.generate( "MyLock", 30*60*60 ); // expire in 30 min
 

Although it is tempting to have these FeatureLock objects stored in a static repository in the manner of GeoServer's TypeRepository.InternalLock - that decision should be left to the individual DataSources.

An AbstractLockingDataSource with appropriate overrideable callbacks may be an elegent way to acomplish this.

Author:
jgarnett, Refractions Research, Inc.

See Also:
Database_Research.pdf, Transactional_WFS_Design.pdf, Design_Implications.pdf
Module:
modules/library/main (gt-main.jar)

Field Summary
 
Fields inherited from interface FeatureLock
TRANSACTION
 
Method Summary
 String getAuthorization()
          LockId used for transaction authorization.
 long getDuration()
          Time from now the lock will expire
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAuthorization

public String getAuthorization()
LockId used for transaction authorization.

Specified by:
getAuthorization in interface FeatureLock
Returns:
A string of the LockId.

getDuration

public long getDuration()
Time from now the lock will expire

Specified by:
getDuration in interface FeatureLock
Returns:
A long of the time till the lock expires.


Copyright © 1996-2009 Geotools. All Rights Reserved.