Package org.jcsp.net.cns

# Class CNSChannelEndManager

java.lang.Object
org.jcsp.net.cns.CNSChannelEndManager

All Implemented Interfaces:
  `NamedChannelEndFactory`, `NamedChannelEndManager`

public class CNSChannelEndManager extends Object implements 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`.

Author:
  Quickstone Technologies Limited
See Also:
  - `NamedChannelEndFactory`
  - `NamedChannelEndManager`
  - `CNSService`

## Constructor Summary

Constructors
Constructor
Description
`CNSChannelEndManager()`
Constructor for CNSChannelEndManager.
`CNSChannelEndManager(CNSUser cnsUser)`

## Method Summary

Modifier and Type
Method
Description
`NetSharedChannelOutput`
`createAny2Net(String name)`
Constructs a `NetSharedChannelOutput` object connected to a `NetChannelInput` located at a location resolved from the specified channel name.
`NetSharedChannelOutput`
`createAny2Net(String name, NameAccessLevel accessLevel)`
Constructs a `NetSharedChannelOutput` object connected to a `NetChannelInput` located at a location resolved from the specified channel name that exists in the supplied namespace.
`NetSharedChannelInput`
`createNet2Any(String name)`
Constructs a `NetSharedChannelInput` object and registers its location with the supplied name in the global namespace of a channel naming service.
`NetSharedChannelInput`
`createNet2Any(String name, NameAccessLevel nameAccessLevel)`
Constructs a `NetSharedChannelInput` object and registers its location with the supplied name in specified namespace of a channel naming service.
`NetAltingChannelInput`
`createNet2One(String name)`
Constructs a `NetAltingChannelInput` object and registers its location with the supplied name in the global namespace of a channel naming service.
`NetAltingChannelInput`
`createNet2One(String name, NameAccessLevel nameAccessLevel)`
Constructs a `NetAltingChannelInput` object and registers its location with the supplied name in specified namespace of a channel naming service.
`NetChannelOutput`
`createOne2Net(String name)`
Constructs a `NetChannelOutput` object connected to a `NetChannelInput` located at a location resolved from the specified channel name.
`NetChannelOutput`
`createOne2Net(String name, NameAccessLevel accessLevel)`
Constructs a `NetChannelOutput` object connected to a `NetChannelInput` located at a location resolved from the specified channel name that exists in the supplied namespace.
`void`
`destroyAllChannelEnds()`
Destroys all channel ends constructed with this instance of the factory.
`void`
`destroyChannelEnd(NetChannelInput chanInEnd)`
Destroys an individual `NetChannelInput` object that was constructed with this instance.
`void`
`destroyChannelEnd(NetChannelOutput chanOutEnd)`
Destroys an individual `NetChannelOutput` object that was constructed with this instance.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CNSChannelEndManager

public CNSChannelEndManager()
Constructor for CNSChannelEndManager.

### CNSChannelEndManager

public CNSChannelEndManager(CNSUser cnsUser)

## Method Details

### createNet2One

public NetAltingChannelInput createNet2One(String name)
Constructs a `NetAltingChannelInput` object and registers its location with the supplied name in the global namespace of a channel naming service.

Specified by:
  `createNet2One` in interface `NamedChannelEndFactory`
Parameters:
  `name` - the name against which to register the channel.
Returns:
  the constructed `NetAltingChannelInput` object.
See Also:
  - `NamedChannelEndFactory.createNet2One(String)`

### createNet2One

public NetAltingChannelInput createNet2One(String name, NameAccessLevel nameAccessLevel)
Constructs a `NetAltingChannelInput` object and registers its location with the supplied name in specified namespace of a channel naming service.

Specified by:
  `createNet2One` in interface `NamedChannelEndFactory`
Parameters:
  `name` - the name against which to register the channel.
  `nameAccessLevel` - the namespace in which to register the name.
Returns:
  the constructed `NetAltingChannelInput` object.
See Also:
  - `NamedChannelEndFactory.createNet2One(String, NameAccessLevel)`

### createNet2Any

public NetSharedChannelInput createNet2Any(String name)
Constructs a `NetSharedChannelInput` object and registers its location with the supplied name in the global namespace of a channel naming service.

Specified by:
  `createNet2Any` in interface `NamedChannelEndFactory`
Parameters:
  `name` - the name against which to register the channel.
Returns:
  the constructed `NetSharedChannelInput` object.
See Also:
  - `NamedChannelEndFactory.createNet2Any(String)`

### createNet2Any

public NetSharedChannelInput createNet2Any(String name, NameAccessLevel nameAccessLevel)
Constructs a `NetSharedChannelInput` object and registers its location with the supplied name in specified namespace of a channel naming service.

Specified by:
  `createNet2Any` in interface `NamedChannelEndFactory`
Parameters:
  `name` - the name against which to register the channel.
  `nameAccessLevel` - the namespace in which to register the name.
Returns:
  the constructed `NetSharedChannelInput` object.
See Also:
  - `NamedChannelEndFactory.createNet2Any(String, NameAccessLevel)`

### createOne2Net

public NetChannelOutput createOne2Net(String name)
Constructs a `NetChannelOutput` object connected to a `NetChannelInput` located at a location resolved from the specified channel name.

Specified by:
  `createOne2Net` in interface `NamedChannelEndFactory`
Parameters:
  `name` - the name of the channel from which to resolve the location.
Returns:
  the constructed `NetChannelOutput` object.
See Also:
  - `NamedChannelEndFactory.createOne2Net(String)`

### createOne2Net

public NetChannelOutput createOne2Net(String name, NameAccessLevel accessLevel)
Constructs a `NetChannelOutput` object connected to a `NetChannelInput` located at a location resolved from the specified channel name that exists in the supplied namespace.

Specified by:
  `createOne2Net` in interface `NamedChannelEndFactory`
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 `NetChannelOutput` object.
See Also:
  - `NamedChannelEndFactory.createOne2Net(String, NameAccessLevel)`

### createAny2Net

public NetSharedChannelOutput createAny2Net(String name)
Constructs a `NetSharedChannelOutput` object connected to a `NetChannelInput` located at a location resolved from the specified channel name.

Specified by:
  `createAny2Net` in interface `NamedChannelEndFactory`
Parameters:
  `name` - the name of the channel from which to resolve the location.
Returns:
  the constructed `NetChannelOutput` object.
See Also:
  - `NamedChannelEndFactory.createAny2Net(String)`

### createAny2Net

public NetSharedChannelOutput createAny2Net(String name, NameAccessLevel accessLevel)
Constructs a `NetSharedChannelOutput` object connected to a `NetChannelInput` located at a location resolved from the specified channel name that exists in the supplied namespace.

Specified by:
  `createAny2Net` in interface `NamedChannelEndFactory`
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 `NetChannelOutput` object.
See Also:
  - `NamedChannelEndFactory.createAny2Net(String, NameAccessLevel)`

### destroyChannelEnd

public void destroyChannelEnd(NetChannelInput chanInEnd)
Destroys an individual `NetChannelInput` object that was constructed with this instance. This will deregister the channel name and destroy the channel end.

Specified by:
  `destroyChannelEnd` in interface `NamedChannelEndManager`
Parameters:
  `chanInEnd` - the channel end to destroy.
See Also:
  - `NamedChannelEndManager.destroyChannelEnd(NetChannelInput)`

### destroyChannelEnd

public void destroyChannelEnd(NetChannelOutput chanOutEnd)
Destroys an individual `NetChannelOutput` object that was constructed with this instance. This will simply destroy the channel end.

Specified by:
  `destroyChannelEnd` in interface `NamedChannelEndManager`
Parameters:
  `chanOutEnd` - the channel end to destroy.
  `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:
  `destroyAllChannelEnds` in interface `NamedChannelEndManager`
See Also:
  - invalid reference

        o.jcsp.net.cns.NamedChannelEndManager#destroyAllChannelEnds()