Package org.jcsp.net2.bns
Class BNSService
java.lang.Object
org.jcsp.net2.bns.BNSService
This is the service object used to register and resolve barrier names with a Barrier Name Server. This provides a
client front end.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NetChannelInput
The incoming channel to receive messages from the BNSprivate final NetChannelOutput
The channel to send messages to the BNS upon -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
register
(String name, NetBarrier bar) Registers a Server end of a NetBarrier with the BNSResolves a name on the BNS, retrieving the NetBarrierLocation for the NetBarrier
-
Field Details
-
toBNS
The channel to send messages to the BNS upon -
fromBNS
The incoming channel to receive messages from the BNS
-
-
Constructor Details
-
BNSService
Creates a new BNSService- Parameters:
bnsNode
- The Node that the BNS is on- Throws:
JCSPNetworkException
- Thrown if something goes wrong in the underlying architecture
-
-
Method Details
-
register
Registers a Server end of a NetBarrier with the BNS- Parameters:
name
- Name to register with BNSbar
- Barrier to register- Returns:
- True if the name was registered successfully, false otherwise
-
resolve
Resolves a name on the BNS, retrieving the NetBarrierLocation for the NetBarrier- Parameters:
name
- The name to resolve from the BNS- Returns:
- The NetBarrierLocation of the NetBarrier declared with name
- Throws:
JCSPNetworkException
- Thrown if something goes wrong in the underlying architecture
-