Package org.jcsp.net.cns
Class CNSChannelEndManager
java.lang.Object
org.jcsp.net.cns.CNSChannelEndManager
- All Implemented Interfaces:
NamedChannelEndFactory,NamedChannelEndManager
This class implements the
NamedChannelEndManager interface;
providing methods for both constructing and destroying channels.
This implementation uses the standard Channel Name Server. Instances
interact with a local CNSService through the use of a
CNSUser object. The default constructor assumes the use
of the default CNS service and obtains the reference itself. The
constructor which takes a CNSUser object allows the use of
an alternative CNS service. A CNSUser object can be
obtained by calling a CNSService object's
getUserObject() method
(CNSService.getUserObject()).
For further information see
NamedChannelEndFactory.- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Hashtableprivate Hashtableprivate CNSUserprivate NetChannelEndFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcreateAny2Net(String name) Constructs aNetSharedChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name.createAny2Net(String name, NameAccessLevel accessLevel) Constructs aNetSharedChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name that exists in the supplied namespace.createNet2Any(String name) Constructs aNetSharedChannelInputobject and registers its location with the supplied name in the global namespace of a channel naming service.createNet2Any(String name, NameAccessLevel nameAccessLevel) Constructs aNetSharedChannelInputobject and registers its location with the supplied name in specified namespace of a channel naming service.createNet2One(String name) Constructs aNetAltingChannelInputobject and registers its location with the supplied name in the global namespace of a channel naming service.createNet2One(String name, NameAccessLevel nameAccessLevel) Constructs aNetAltingChannelInputobject and registers its location with the supplied name in specified namespace of a channel naming service.createOne2Net(String name) Constructs aNetChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name.createOne2Net(String name, NameAccessLevel accessLevel) Constructs aNetChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name that exists in the supplied namespace.voidDestroys all channel ends constructed with this instance of the factory.voiddestroyChannelEnd(NetChannelInput chanInEnd) Destroys an individualNetChannelInputobject that was constructed with this instance.voiddestroyChannelEnd(NetChannelOutput chanOutEnd) Destroys an individualNetChannelOutputobject that was constructed with this instance.
-
Field Details
-
channelInputRegistrations
-
channelOutputsCreated
-
cnsUser
-
factoryToUse
-
-
Constructor Details
-
CNSChannelEndManager
public CNSChannelEndManager()Constructor for CNSChannelEndManager. -
CNSChannelEndManager
-
-
Method Details
-
checkCnsService
private void checkCnsService() -
createNet2One
Constructs aNetAltingChannelInputobject and registers its location with the supplied name in the global namespace of a channel naming service.- Specified by:
createNet2Onein interfaceNamedChannelEndFactory- Parameters:
name- the name against which to register the channel.- Returns:
- the constructed
NetAltingChannelInputobject. - See Also:
-
createNet2One
Constructs aNetAltingChannelInputobject and registers its location with the supplied name in specified namespace of a channel naming service.- Specified by:
createNet2Onein interfaceNamedChannelEndFactory- Parameters:
name- the name against which to register the channel.nameAccessLevel- the namespace in which to register the name.- Returns:
- the constructed
NetAltingChannelInputobject. - See Also:
-
createNet2Any
Constructs aNetSharedChannelInputobject and registers its location with the supplied name in the global namespace of a channel naming service.- Specified by:
createNet2Anyin interfaceNamedChannelEndFactory- Parameters:
name- the name against which to register the channel.- Returns:
- the constructed
NetSharedChannelInputobject. - See Also:
-
createNet2Any
Constructs aNetSharedChannelInputobject and registers its location with the supplied name in specified namespace of a channel naming service.- Specified by:
createNet2Anyin interfaceNamedChannelEndFactory- Parameters:
name- the name against which to register the channel.nameAccessLevel- the namespace in which to register the name.- Returns:
- the constructed
NetSharedChannelInputobject. - See Also:
-
createOne2Net
Constructs aNetChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name.- Specified by:
createOne2Netin interfaceNamedChannelEndFactory- Parameters:
name- the name of the channel from which to resolve the location.- Returns:
- the constructed
NetChannelOutputobject. - See Also:
-
createOne2Net
Constructs aNetChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name that exists in the supplied namespace.- Specified by:
createOne2Netin interfaceNamedChannelEndFactory- Parameters:
name- the name of the channel from which to resolve the location.accessLevel- the namespace in which the channel name exists.- Returns:
- the constructed
NetChannelOutputobject. - See Also:
-
createAny2Net
Constructs aNetSharedChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name.- Specified by:
createAny2Netin interfaceNamedChannelEndFactory- Parameters:
name- the name of the channel from which to resolve the location.- Returns:
- the constructed
NetChannelOutputobject. - See Also:
-
createAny2Net
Constructs aNetSharedChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name that exists in the supplied namespace.- Specified by:
createAny2Netin interfaceNamedChannelEndFactory- Parameters:
name- the name of the channel from which to resolve the location.accessLevel- the namespace in which the channel name exists.- Returns:
- the constructed
NetChannelOutputobject. - See Also:
-
destroyChannelEnd
Destroys an individualNetChannelInputobject that was constructed with this instance. This will deregister the channel name and destroy the channel end.- Specified by:
destroyChannelEndin interfaceNamedChannelEndManager- Parameters:
chanInEnd- the channel end to destroy.- See Also:
-
destroyChannelEnd
Destroys an individualNetChannelOutputobject that was constructed with this instance. This will simply destroy the channel end.- Specified by:
destroyChannelEndin interfaceNamedChannelEndManager- Parameters:
chanOutEnd- the channel end to destroy.chanInEnd- the channel end to destroy.- See Also:
-
destroyAllChannelEnds
public void destroyAllChannelEnds()Destroys all channel ends constructed with this instance of the factory.- Specified by:
destroyAllChannelEndsin interfaceNamedChannelEndManager- See Also:
-