class InputReconnectionManagerCNSImpl extends java.lang.Object implements InputReconnectionManager
InputReconnectionManager
to work with a CNS service for resolution
of the channel's current location.Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
anonymousCnsNamePrefix
Unique prefix to use when registering channels with the CNS.
|
private NetAltingChannelInput |
chanIn
The underlying input channel end.
|
(package private) java.lang.Class |
channelFactoryClass
The factory class used to create the channel end.
|
private NetChannelLocation |
cnsNetChannelLocation
Current location of the channel.
|
private java.lang.String |
cnsRegisteredName
Name registered with the CNS.
|
private NameAccessLevel |
cnsRegisteredNameAccessLevel
NameAccessLevel used to register the name against with the CNS. |
private java.lang.String |
cnsServiceNameToUse
Identification of the CNS service to use.
|
private ChannelNameKey |
key
The name key allocated to the channel.
|
private static int |
MSG_CHAN_NETWORKED
Constant for representing a possible channel state.
|
private static int |
MSG_CHAN_SERIALIZABLE
Constant for representing a possible channel state.
|
private static int |
MSG_TERMINATE
Constant for representing a possible channel state.
|
private boolean |
serializable
True if the channel end has been prepared for serialization (migration).
|
Constructor and Description |
---|
InputReconnectionManagerCNSImpl(NetAltingChannelInput chanIn)
Constructs a new
InputReconnectionManagerCNSImpl for use with the given input
channel. |
InputReconnectionManagerCNSImpl(NetAltingChannelInput chanIn,
java.lang.String cnsServiceName)
Constructs a new
InputReconnectionManagerCNSImpl for use with the given input
channel and a specific CNS service. |
InputReconnectionManagerCNSImpl(NetAltingChannelInput chanIn,
java.lang.String name,
NameAccessLevel accessLevel,
ChannelNameKey key)
Constructs a new
InputReconnectionManagerCNSImpl for use with CNS registered
channels using NameAccessLevel application isolation. |
InputReconnectionManagerCNSImpl(NetAltingChannelInput chanIn,
java.lang.String name,
NameAccessLevel accessLevel,
ChannelNameKey key,
java.lang.String cnsServiceName)
Constructs a new
InputReconnectionManagerCNSImpl for use with CNS registered
channels. |
Modifier and Type | Method and Description |
---|---|
NetChannelLocation |
getCurrentLocation()
Returns the current location of the channel.
|
NetAltingChannelInput |
getInputChannel()
Obtain the
NetAltingChannelInput object to use. |
void |
prepareToMove()
This method must be called before an instance of this class
is serializable.
|
private void |
readObject(java.io.ObjectInputStream in)
Serialization method to read this object from a stream.
|
private void |
writeObject(java.io.ObjectOutputStream out)
Serialization method to write this object to a stream.
|
private NetAltingChannelInput chanIn
java.lang.Class channelFactoryClass
private java.lang.String cnsServiceNameToUse
private java.lang.String cnsRegisteredName
private NameAccessLevel cnsRegisteredNameAccessLevel
NameAccessLevel
used to register the name against with the CNS.private ChannelNameKey key
private transient boolean serializable
private transient NetChannelLocation cnsNetChannelLocation
private static final int MSG_CHAN_SERIALIZABLE
private static final int MSG_CHAN_NETWORKED
private static final int MSG_TERMINATE
static final java.lang.String anonymousCnsNamePrefix
public InputReconnectionManagerCNSImpl(NetAltingChannelInput chanIn)
InputReconnectionManagerCNSImpl
for use with the given input
channel. The default CNS service name will be used.chanIn
- the input channel end.public InputReconnectionManagerCNSImpl(NetAltingChannelInput chanIn, java.lang.String cnsServiceName)
InputReconnectionManagerCNSImpl
for use with the given input
channel and a specific CNS service.chanIn
- the input channel end.cnsServiceName
- name of the CNS service to use.public InputReconnectionManagerCNSImpl(NetAltingChannelInput chanIn, java.lang.String name, NameAccessLevel accessLevel, ChannelNameKey key)
InputReconnectionManagerCNSImpl
for use with CNS registered
channels using NameAccessLevel
application isolation. The default CNS service name
is used.chanIn
- the input channel end.name
- the CNS registered name of the channel.accessLevel
- the application isolation level.key
- the allocated channel key.public InputReconnectionManagerCNSImpl(NetAltingChannelInput chanIn, java.lang.String name, NameAccessLevel accessLevel, ChannelNameKey key, java.lang.String cnsServiceName)
InputReconnectionManagerCNSImpl
for use with CNS registered
channels.chanIn
- the input channel end.name
- the CNS registered name of the channel.accessLevel
- the application isolation level.key
- the allocated channel key.cnsServiceName
- name of the CNS service to use.public NetAltingChannelInput getInputChannel()
NetAltingChannelInput
object to use.
After serialization, the first call to this method will reconstruct
the channel and register it with the CNS.
If there is a problem while trying to construct a channel,
a ChannelEndContructionException
will be thrown.getInputChannel
in interface InputReconnectionManager
InputReconnectionManager.getInputChannel()
public NetChannelLocation getCurrentLocation()
getInputChannel()
has been called to resolve the channel being managed.getCurrentLocation
in interface InputReconnectionManager
public void prepareToMove()
getInputChannel()
has not been called.prepareToMove
in interface InputReconnectionManager
InputReconnectionManager.prepareToMove()
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
out
- destination stream to serialize to.java.io.IOException
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- the source stream.java.io.IOException
java.lang.ClassNotFoundException