org.geotools.data
Class FeatureLockFactory

Object
  extended by FeatureLockFactory
All Implemented Interfaces:
Factory
Direct Known Subclasses:
DefaultFeatureLockFactory

public abstract class FeatureLockFactory
extends Object
implements Factory

This specifies the interface to create FeatureLocks.

Sample use:

 FeatureLock lock = FeatureLockFactory.generate( "MyLock", 3600 );
 

Author:
Chris Holmes, TOPP
Module:
TODO:
REVISIT: Combine this with a factory to also make Query objects?

Constructor Summary
FeatureLockFactory()
           
 
Method Summary
protected abstract  FeatureLock createLock(String name, long duration)
           
static FeatureLock generate(long duration)
          Generates a new FeatureLock for use.
static FeatureLock generate(String name, long duration)
          Generates a new FeatureLock for use.
 Map getImplementationHints()
          Returns the implementation hints.
static FeatureLockFactory getInstance()
          Gets an instance of the FeatureLockFactory.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureLockFactory

public FeatureLockFactory()
Method Detail

getInstance

public static FeatureLockFactory getInstance()
                                      throws FactoryRegistryException
Gets an instance of the FeatureLockFactory.

Returns:
A FeatureLockFactory instance.
Throws:
FactoryRegistryException - If there exists a configuration error.

generate

public static FeatureLock generate(long duration)
Generates a new FeatureLock for use.

The lock will be of the form:

 LockID{number}
 Where:
   {number} - is unique based on time and expiration requested
 

The resulting lock is unique.

To aid in tracing your may wish to supply your own name, rather than LockID, for use in lock generation.

Parameters:
duration - FeatureLock duration in milliseconds

generate

public static FeatureLock generate(String name,
                                   long duration)
Generates a new FeatureLock for use. The lock will be of the form:
 {name}{number}
 Where:
   {number} - is unique based on time and expiration requested
 
The resulting lock is unique.

To aid in tracing your may wish to supply your own name, rather than LockID, for use in lock generation.

Parameters:
name - User supplied name used in lock generation.
duration - Date lock expires on.

createLock

protected abstract FeatureLock createLock(String name,
                                          long duration)

getImplementationHints

public Map getImplementationHints()
Returns the implementation hints. The default implementation returns en empty map.

Specified by:
getImplementationHints in interface Factory
Returns:
The map of hints, or an empty map if none.


Copyright © 1996-2009 Geotools. All Rights Reserved.