org.apache.commons.id.uuid
Class NodeManagerImpl

java.lang.Object
  extended by org.apache.commons.id.uuid.NodeManagerImpl
All Implemented Interfaces:
NodeManager

public final class NodeManagerImpl
extends java.lang.Object
implements NodeManager

Class is responsible for managing the Nodes identified for this system (JVM instance), as well as the state management for the Nodes.

Version:
$Revision: 480488 $ $Date: 2006-11-29 08:57:26 +0000 (Wed, 29 Nov 2006) $
Author:
Commons-Id team

Constructor Summary
NodeManagerImpl()
          Constructor for class.
 
Method Summary
 Node currentNode()
          Returns the current node in use for uuid generation.
protected  void finalize()
          Asks the State implementation to store.
 void init()
          Initialization
 void lockNode(Node node)
          Locks a node for use by a generator.
 Node nextAvailableNode()
          Returns the next available Node for uuid generation.
 void releaseNode(Node node)
          Releases a node locked by a generator.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeManagerImpl

public NodeManagerImpl()
Constructor for class.

Method Detail

init

public void init()
Initialization


currentNode

public Node currentNode()

Returns the current node in use for uuid generation. Calls to this method also signal the NodeManagerImpl when to store uuid state information.

Specified by:
currentNode in interface NodeManager
Returns:
the current node in use for uuid generation.

nextAvailableNode

public Node nextAvailableNode()

Returns the next available Node for uuid generation.

Specified by:
nextAvailableNode in interface NodeManager
Returns:
the next available Node for uuid generation.

lockNode

public void lockNode(Node node)

Locks a node for use by a generator.

Specified by:
lockNode in interface NodeManager
Parameters:
node - the Node to lock.

releaseNode

public void releaseNode(Node node)

Releases a node locked by a generator.

Specified by:
releaseNode in interface NodeManager
Parameters:
node - the Node to release.

finalize

protected void finalize()
                 throws java.lang.Throwable

Asks the State implementation to store.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable
See Also:
Object.finalize()


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.