org.geotools.data
Class FeatureLockFactory

java.lang.Object
  extended byorg.geotools.data.FeatureLockFactory
All Implemented Interfaces:
Factory
Direct Known Subclasses:
DefaultFeatureLockFactory

public abstract class FeatureLockFactory
extends java.lang.Object
implements Factory

This specifies the interface to create FeatureLocks.

Sample use:

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

Version:
$Id: FeatureLockFactory.java 17701 2006-01-23 00:00:51Z desruisseaux $
Author:
Chris Holmes, TOPP
Task:
REVISIT: Combine this with a factory to also make Query objects?

Constructor Summary
FeatureLockFactory()
           
 
Method Summary
protected abstract  FeatureLock createLock(java.lang.String name, long duration)
           
static FeatureLock generate(long duration)
          Generates a new FeatureLock for use.
static FeatureLock generate(java.lang.String name, long duration)
          Generates a new FeatureLock for use.
 java.util.Map getImplementationHints()
          Returns the implementation hints.
static FeatureLockFactory getInstance()
          Gets an instance of the FeatureLockFactory.
 
Methods inherited from class java.lang.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 FactoryConfigurationError
Gets an instance of the FeatureLockFactory.

Returns:
A FeatureLockFactory instance.
Throws:
FactoryConfigurationError - 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 seconds

generate

public static FeatureLock generate(java.lang.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.

createLock

protected abstract FeatureLock createLock(java.lang.String name,
                                          long duration)

getImplementationHints

public java.util.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 © GeoTools. All Rights Reserved.