Package org.jcsp.net2.cns
Class CNSService
java.lang.Object
org.jcsp.net2.cns.CNSService
This is the service object used to register and resolve channel names with a Channel Name Server. This provides a
client front end.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NetChannelInput
The incoming channel to receive messages from the CNS fromprivate final NetChannelOutput
The channel to send messages to the CNS upon -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
register
(String name, NetChannelInput in) Registers an input end with the CNSResolves a name on the CNS, retrieving the NetChannelLocation for the channel
-
Field Details
-
toCNS
The channel to send messages to the CNS upon -
fromCNS
The incoming channel to receive messages from the CNS from
-
-
Constructor Details
-
CNSService
Creates a new CNSService- Parameters:
cnsNode
- The NodeID of the Node with the CNS on it- Throws:
JCSPNetworkException
- Thrown if something goes wrong in the underlying architecture
-
-
Method Details
-
register
Registers an input end with the CNS- Parameters:
name
- The name to register the channel within
- The NetChannelInput to register with the CNS- Returns:
- True if the channel was successfully registered, false otherwise
-
resolve
Resolves a name on the CNS, retrieving the NetChannelLocation for the channel- Parameters:
name
- The name to resolve- Returns:
- The NetChannelLocation of the channel declared name
- Throws:
JCSPNetworkException
- Thrown if something goes wrong in the underlying architecture
-