Package org.jcsp.net2

Class NodeFactory

  • Direct Known Subclasses:
    TCPIPNodeFactory

    public abstract class NodeFactory
    extends java.lang.Object
    Used to initialise a Node by connecting to the CNS. This approach is now deprecated. To initialise a Node now:

    NodeAddress localAddress = ...;
    NodeAddress nodeServerAddr = ...;
    Node.getInstance().init(localAddress);
    CNS.init(nodeServerAddr);
    BNS.init(nodeServerAddr);

    See Also:
    Node
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected NodeAddress cnsAddress
      The NodeAddress where the CNS / BNS is located
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeFactory()  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      protected abstract NodeAddress initNode​(Node node)
      Initialises a Node
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • cnsAddress

        protected NodeAddress cnsAddress
        The NodeAddress where the CNS / BNS is located
    • Constructor Detail

      • NodeFactory

        public NodeFactory()
    • Method Detail

      • initNode

        protected abstract NodeAddress initNode​(Node node)
                                         throws JCSPNetworkException
        Initialises a Node
        Parameters:
        node - The Node to initialise
        Returns:
        A new NodeAddress for the Node
        Throws:
        JCSPNetworkException - Thrown if something goes wrong during the initialisation