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(String name,
int enrolled)
Creates a new client end of a NetBarrier
|
static NetBarrier |
netBarrier(String name,
int localEnrolled,
int netEnrolled)
Creates a new server end of a NetBarrier with the given name
|
static NetBarrier |
numberedNetBarrier(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(String name, int localEnrolled, int netEnrolled) throws IllegalArgumentException, IllegalStateException
name
- The name to register with the BNSlocalEnrolled
- The number of locally enrolled processesnetEnrolled
- The number of net enrolled processes to expectIllegalArgumentException
- Thrown if the parameters are outside the defined rangesIllegalStateException
- Thrown if the BNS connection has not been initialisedpublic static NetBarrier numberedNetBarrier(String name, int index, int localEnrolled, int netEnrolled) throws IllegalArgumentException, 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 forIllegalArgumentException
- Thrown if the parameters are outside the defined rangesIllegalStateException
- Thrown if the connection to the BNS has not been initialisedpublic static NetBarrier netBarrier(String name, int enrolled) throws IllegalArgumentException, IllegalStateException, JCSPNetworkException
name
- The name to resolve with the BNSenrolled
- The number of locally enrolled processesJCSPNetworkException
- Thrown if something goes wrong in the underlying architectureIllegalArgumentException
- Thrown if the number of of local enrolled is outside the defined rangeIllegalStateException
- Thrown if the connection to the BNS has not been initialisedCopyright © 1996–2015. All rights reserved.