planet.generic.commonapi.factory
Class NodeHandleFactoryImpl

java.lang.Object
  extended byplanet.generic.commonapi.factory.NodeHandleFactoryImpl
All Implemented Interfaces:
NodeHandleFactory, java.io.Serializable

public class NodeHandleFactoryImpl
extends java.lang.Object
implements NodeHandleFactory

It is a specific implementation of NodeHandleFactory that permits to build any class of NodeHandle with any type of Id. So, it requires the Class reference for the related NodeHandle.

Author:
Jordi Pujol 07-jul-2005
See Also:
Serialized Form

Constructor Summary
NodeHandleFactoryImpl()
          Builds a NodeHandleFactoryImpl instance.
 
Method Summary
 NodeHandle buildNodeHandle(Id id, boolean alive)
          Builds a NodeHandle with the actual implementation class of NodeHandle and specifieds id and alive flag.
 NodeHandleFactory setValues(java.lang.Class nodeHandle)
          Sets the initial values for the NodeHandleFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeHandleFactoryImpl

public NodeHandleFactoryImpl()
Builds a NodeHandleFactoryImpl instance. Does nothing. Requires the setValues(...) invokation.

Method Detail

setValues

public NodeHandleFactory setValues(java.lang.Class nodeHandle)
                            throws InitializationException
Sets the initial values for the NodeHandleFactory.

Specified by:
setValues in interface NodeHandleFactory
Parameters:
nodeHandle - Class reference to build new NodeHandles.
Returns:
The same instance once it has been updated.
Throws:
InitializationException - if some error occurs during the initialization process.
See Also:
NodeHandleFactory.setValues(java.lang.Class)

buildNodeHandle

public NodeHandle buildNodeHandle(Id id,
                                  boolean alive)
                           throws InitializationException
Builds a NodeHandle with the actual implementation class of NodeHandle and specifieds id and alive flag.

Specified by:
buildNodeHandle in interface NodeHandleFactory
Parameters:
id - Id of the related Node, to assign to the new instance of NodeNandle.
alive - true if the related Node is alive. false in other case.
Returns:
An instance of actual implementation class of NodeHandle.
Throws:
InitializationException
See Also:
NodeHandleFactory.buildNodeHandle(planet.commonapi.Id, boolean), Id