Package org.jcsp.net.cns
Class CNSChannelEndManager
- java.lang.Object
-
- org.jcsp.net.cns.CNSChannelEndManager
-
- All Implemented Interfaces:
NamedChannelEndFactory,NamedChannelEndManager
public class CNSChannelEndManager extends java.lang.Object implements NamedChannelEndManager
This class implements theNamedChannelEndManagerinterface; providing methods for both constructing and destroying channels. This implementation uses the standard Channel Name Server. Instances interact with a localCNSServicethrough the use of aCNSUserobject. The default constructor assumes the use of the default CNS service and obtains the reference itself. The constructor which takes aCNSUserobject allows the use of an alternative CNS service. ACNSUserobject can be obtained by calling aCNSServiceobject'sgetUserObject()method (CNSService.getUserObject()). For further information seeNamedChannelEndFactory.- See Also:
NamedChannelEndFactory,NamedChannelEndManager,CNSService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classCNSChannelEndManager.ChannelRegistration
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashtablechannelInputRegistrationsprivate java.util.HashtablechannelOutputsCreatedprivate CNSUsercnsUserprivate NetChannelEndFactoryfactoryToUse
-
Constructor Summary
Constructors Constructor Description CNSChannelEndManager()Constructor for CNSChannelEndManager.CNSChannelEndManager(CNSUser cnsUser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckCnsService()NetSharedChannelOutputcreateAny2Net(java.lang.String name)Constructs aNetSharedChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name.NetSharedChannelOutputcreateAny2Net(java.lang.String name, NameAccessLevel accessLevel)Constructs aNetSharedChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name that exists in the supplied namespace.NetSharedChannelInputcreateNet2Any(java.lang.String name)Constructs aNetSharedChannelInputobject and registers its location with the supplied name in the global namespace of a channel naming service.NetSharedChannelInputcreateNet2Any(java.lang.String name, NameAccessLevel nameAccessLevel)Constructs aNetSharedChannelInputobject and registers its location with the supplied name in specified namespace of a channel naming service.NetAltingChannelInputcreateNet2One(java.lang.String name)Constructs aNetAltingChannelInputobject and registers its location with the supplied name in the global namespace of a channel naming service.NetAltingChannelInputcreateNet2One(java.lang.String name, NameAccessLevel nameAccessLevel)Constructs aNetAltingChannelInputobject and registers its location with the supplied name in specified namespace of a channel naming service.NetChannelOutputcreateOne2Net(java.lang.String name)Constructs aNetChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name.NetChannelOutputcreateOne2Net(java.lang.String name, NameAccessLevel accessLevel)Constructs aNetChannelOutputobject connected to aNetChannelInputlocated at a location resolved from the specified channel name that exists in the supplied namespace.voiddestroyAllChannelEnds()Destroys 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 Detail
-
channelInputRegistrations
private java.util.Hashtable channelInputRegistrations
-
channelOutputsCreated
private java.util.Hashtable channelOutputsCreated
-
cnsUser
private CNSUser cnsUser
-
factoryToUse
private NetChannelEndFactory factoryToUse
-
-
Constructor Detail
-
CNSChannelEndManager
public CNSChannelEndManager()
Constructor for CNSChannelEndManager.
-
CNSChannelEndManager
public CNSChannelEndManager(CNSUser cnsUser)
-
-
Method Detail
-
checkCnsService
private void checkCnsService()
-
createNet2One
public NetAltingChannelInput createNet2One(java.lang.String name)
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:
NamedChannelEndFactory.createNet2One(String)
-
createNet2One
public NetAltingChannelInput createNet2One(java.lang.String name, NameAccessLevel nameAccessLevel)
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:
NamedChannelEndFactory.createNet2One(String, NameAccessLevel)
-
createNet2Any
public NetSharedChannelInput createNet2Any(java.lang.String name)
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:
NamedChannelEndFactory.createNet2Any(String)
-
createNet2Any
public NetSharedChannelInput createNet2Any(java.lang.String name, NameAccessLevel nameAccessLevel)
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:
NamedChannelEndFactory.createNet2Any(String, NameAccessLevel)
-
createOne2Net
public NetChannelOutput createOne2Net(java.lang.String name)
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:
NamedChannelEndFactory.createOne2Net(String)
-
createOne2Net
public NetChannelOutput createOne2Net(java.lang.String name, NameAccessLevel accessLevel)
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:
NamedChannelEndFactory.createOne2Net(String, NameAccessLevel)
-
createAny2Net
public NetSharedChannelOutput createAny2Net(java.lang.String name)
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:
NamedChannelEndFactory.createAny2Net(String)
-
createAny2Net
public NetSharedChannelOutput createAny2Net(java.lang.String name, NameAccessLevel accessLevel)
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:
NamedChannelEndFactory.createAny2Net(String, NameAccessLevel)
-
destroyChannelEnd
public void destroyChannelEnd(NetChannelInput chanInEnd)
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:
NamedChannelEndManager.destroyChannelEnd(NetChannelInput)
-
destroyChannelEnd
public void destroyChannelEnd(NetChannelOutput chanOutEnd)
Destroys an individualNetChannelOutputobject that was constructed with this instance. This will simply destroy the channel end.- Specified by:
destroyChannelEndin interfaceNamedChannelEndManager- Parameters:
chanInEnd- the channel end to destroy.- See Also:
NamedChannelEndManager.destroyChannelEnd(NetChannelOutput)
-
destroyAllChannelEnds
public void destroyAllChannelEnds()
Destroys all channel ends constructed with this instance of the factory.- Specified by:
destroyAllChannelEndsin interfaceNamedChannelEndManager- See Also:
o.jcsp.net.cns.NamedChannelEndManager#destroyAllChannelEnds()
-
-