Package org.jcsp.net2

Class NetBarrierEnd


  • public final class NetBarrierEnd
    extends java.lang.Object
    This class is the factory class for creating NetBarrier objects. For information, see NetBarrier.
    See Also:
    NetBarrier
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private NetBarrierEnd()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static NetBarrier netBarrier​(int localEnrolled, int netEnrolled)
      Creates a new server end of a NetBarrier
      static NetBarrier netBarrier​(NetBarrierLocation loc, int enrolled)
      Creates a new client end of a NetBarrier
      static NetBarrier netBarrier​(NodeAddress addr, int vbn, int enrolled)
      Creates a new client end of a NetBarrier connected to the barrier with the given index on the given Node
      static NetBarrier netBarrier​(NodeID nodeID, int vbn, int enrolled)
      Creates a new client end of a NetBarrier connected to the barrier with the given index on the given Node
      static NetBarrier numberedNetBarrier​(int index, int localEnrolled, int netEnrolled)
      Creates a new server end of a NetBarrier with a given index
      • Methods inherited from class java.lang.Object

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

      • NetBarrierEnd

        private NetBarrierEnd()
    • Method Detail

      • netBarrier

        public static NetBarrier netBarrier​(int localEnrolled,
                                            int netEnrolled)
                                     throws java.lang.IllegalArgumentException
        Creates a new server end of a NetBarrier
        Parameters:
        localEnrolled - The number of locally enrolled processes
        netEnrolled - The number of net enrolled processes to expect
        Returns:
        A new NetBarrier server end with the number of enrolled processes
        Throws:
        java.lang.IllegalArgumentException - Thrown if the parameters are outside the defined ranges
      • numberedNetBarrier

        public static NetBarrier numberedNetBarrier​(int index,
                                                    int localEnrolled,
                                                    int netEnrolled)
                                             throws java.lang.IllegalArgumentException
        Creates a new server end of a NetBarrier with a given index
        Parameters:
        index - The index to create the NetBarrier with
        localEnrolled - The number of locally enrolled processes
        netEnrolled - The number of remote enrollments to wait for
        Returns:
        A new NetBarrier
        Throws:
        java.lang.IllegalArgumentException - Thrown if the parameters are outside the defined ranges
      • netBarrier

        public static NetBarrier netBarrier​(NetBarrierLocation loc,
                                            int enrolled)
                                     throws JCSPNetworkException,
                                            java.lang.IllegalArgumentException
        Creates a new client end of a NetBarrier
        Parameters:
        loc - The location of the server end of the NetBarrier
        enrolled - The number of locally enrolled processes
        Returns:
        A new NetBarrier client end with the number of enrolled processes
        Throws:
        JCSPNetworkException - Thrown if something goes wrong in the underlying architecture
        java.lang.IllegalArgumentException - Thrown if the number of of local enrolled is outside the defined range
      • netBarrier

        public static NetBarrier netBarrier​(NodeID nodeID,
                                            int vbn,
                                            int enrolled)
                                     throws JCSPNetworkException,
                                            java.lang.IllegalArgumentException
        Creates a new client end of a NetBarrier connected to the barrier with the given index on the given Node
        Parameters:
        nodeID - The NodeID of the Node to connect to
        vbn - The index of the barrier on the remote Node
        enrolled - The number of locally enrolled processes
        Returns:
        A new client end of a NetBarrier
        Throws:
        JCSPNetworkException - Thrown is something goes wrong in the underlying architecture
        java.lang.IllegalArgumentException - Thrown if the number of enrolled is outside the defined range
      • netBarrier

        public static NetBarrier netBarrier​(NodeAddress addr,
                                            int vbn,
                                            int enrolled)
                                     throws JCSPNetworkException,
                                            java.lang.IllegalArgumentException
        Creates a new client end of a NetBarrier connected to the barrier with the given index on the given Node
        Parameters:
        addr - NodeAddres of the Node that the barrier is located
        vbn - Index of the barrier to connect to
        enrolled - The number of locally enrolled processes
        Returns:
        A new client end of a NetBarrier
        Throws:
        JCSPNetworkException - Thrown if something goes wrong in the underlying architecture
        java.lang.IllegalArgumentException - Thrown if the number of enrolled processes is outside the defined range.