|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.generic.commonapi.factory.NodeFactoryImpl
This is a specific implementation of NodeFactory that permits build any class of Node with any type of Id. It is possible by identifies theese parameters in properties file:
Field Summary | |
protected java.lang.String |
propertiesFile
Properties file name whose read properties. |
Constructor Summary | |
NodeFactoryImpl(java.lang.Class idFactory,
java.lang.Class nodeClass,
java.lang.Class idClass,
java.lang.String topology,
int networkSize)
Initializes a new instance of NodeFactory with the classes idFactory and nodeClass specifieds by parameter. |
|
NodeFactoryImpl(IdFactory idFactory,
java.lang.Class nodeClass,
java.lang.String topology)
Initializes a new instance of NodeFactory with the idFactory and nodeClass specifieds by parameter. |
|
NodeFactoryImpl(java.lang.String propertiesFile)
This constructor reads the properties' file and initializes the IdFactory and Class for new Nodes. |
Method Summary | |
Node |
buildNode()
Builds a NodeImpl with the actual IdFactory and class for the nodes. |
Node |
buildNode(Id id)
Builds a node with the actual implementation class of NodeImpl and the specified id. |
IdFactory |
getIdFactory()
Gets the actual IdFactory in use. |
java.lang.Class |
getNodeClass()
Gets the actual class of implementation of NodeImpl returned by this factory. |
java.lang.String |
getTopology()
Gets the actual topology for the network. |
void |
setIdFactory(IdFactory idFactory)
Sets the IdFactory to use in the future. |
void |
setNodeClass(java.lang.Class nodeClass)
Sets the class of an implementation of NodeImpl to return by this factory in the future. |
void |
setTopology(java.lang.String topology)
Sets the topology of the network to know how generates new Ids. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String propertiesFile
Constructor Detail |
public NodeFactoryImpl(java.lang.String propertiesFile) throws InitializationException
InitializationException
- If occur any problem during
initialization steps.public NodeFactoryImpl(java.lang.Class idFactory, java.lang.Class nodeClass, java.lang.Class idClass, java.lang.String topology, int networkSize) throws InitializationException
idFactory
- IdFactory class that permits build new Ids for
the new Nodes.nodeClass
- Class for new Nodes.topology
- Topology of the target network.
InitializationException
- If exists any problem with
initialization of both classes.Id
public NodeFactoryImpl(IdFactory idFactory, java.lang.Class nodeClass, java.lang.String topology) throws InitializationException
idFactory
- Instance of IdFactory that permits build new Ids for
the new Nodes.nodeClass
- Class for new Nodes.topology
- Topology of the target network.
InitializationException
- If exists any problem with
initialization.Id
Method Detail |
public Node buildNode() throws InitializationException
buildNode
in interface NodeFactory
InitializationException
NodeFactory.buildNode()
,
IdFactory
,
Id
,
Node
public Node buildNode(Id id) throws InitializationException
buildNode
in interface NodeFactory
id
- Id to assign to the new instance of NodeImpl.
InitializationException
NodeFactory.buildNode(planet.commonapi.Id)
,
IdFactory
,
Id
,
Node
public IdFactory getIdFactory()
getIdFactory
in interface NodeFactory
NodeFactory.getIdFactory()
public void setIdFactory(IdFactory idFactory)
setIdFactory
in interface NodeFactory
idFactory
- The new IdFactory to use in the future.NodeFactory.setIdFactory(planet.commonapi.factory.IdFactory)
public java.lang.Class getNodeClass()
getNodeClass
in interface NodeFactory
NodeFactory.getNodeClass()
public void setNodeClass(java.lang.Class nodeClass) throws InitializationException
setNodeClass
in interface NodeFactory
nodeClass
- Class of an implementation of NodeImpl to return by
this factory.
InitializationException
NodeFactory.setNodeClass(java.lang.Class)
public java.lang.String getTopology()
getTopology
in interface NodeFactory
NodeFactory.getTopology()
public void setTopology(java.lang.String topology) throws InitializationException
setTopology
in interface NodeFactory
topology
- Topology of the network.
InitializationException
NodeFactory.setTopology(java.lang.String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |