public class BNS extends java.lang.Object implements CSProcess
CNS,
BNSService,
Node| Modifier and Type | Method and Description |
|---|---|
static BNS |
getInstance()
Gets the singleton instance of the BNS
|
static void |
initialise(NodeAddress bnsNode)
Initialises the connection to the BNS
|
static void |
initialise(NodeID bnsNode)
Initialises the connection to the BNS
|
static NetBarrier |
netBarrier(java.lang.String name,
int enrolled)
Creates a new client end of a NetBarrier
|
static NetBarrier |
netBarrier(java.lang.String name,
int localEnrolled,
int netEnrolled)
Creates a new server end of a NetBarrier with the given name
|
static NetBarrier |
numberedNetBarrier(java.lang.String name,
int index,
int localEnrolled,
int netEnrolled)
Creates a new server end of a NetBarrier with a given index and name
|
void |
run()
The run method for the BNS process
|
public static BNS getInstance()
public static void initialise(NodeID bnsNode) throws JCSPNetworkException
bnsNode - The NodeID of the BNS NodeJCSPNetworkException - Thrown if something goes wrong in the underlying architecturepublic static void initialise(NodeAddress bnsNode) throws JCSPNetworkException
bnsNode - The NodeAddress of the BNS NodeJCSPNetworkException - Thrown if something goes wrong in the underlying architecturepublic static NetBarrier netBarrier(java.lang.String name, int localEnrolled, int netEnrolled) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
name - The name to register with the BNSlocalEnrolled - The number of locally enrolled processesnetEnrolled - The number of net enrolled processes to expectjava.lang.IllegalArgumentException - Thrown if the parameters are outside the defined rangesjava.lang.IllegalStateException - Thrown if the BNS connection has not been initialisedpublic static NetBarrier numberedNetBarrier(java.lang.String name, int index, int localEnrolled, int netEnrolled) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
name - Name to register with the BNSindex - The index to create the NetBarrier withlocalEnrolled - The number of locally enrolled processesnetEnrolled - The number of remote enrollments to wait forjava.lang.IllegalArgumentException - Thrown if the parameters are outside the defined rangesjava.lang.IllegalStateException - Thrown if the connection to the BNS has not been initialisedpublic static NetBarrier netBarrier(java.lang.String name, int enrolled) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, JCSPNetworkException
name - The name to resolve with the BNSenrolled - The number of locally enrolled processesJCSPNetworkException - Thrown if something goes wrong in the underlying architecturejava.lang.IllegalArgumentException - Thrown if the number of of local enrolled is outside the defined rangejava.lang.IllegalStateException - Thrown if the connection to the BNS has not been initialisedCopyright © 1996–2022. All rights reserved.