class VirtualSession extends BaseSession
Session
interface, built upon
BaseSession
. This implementation is to be used for virtual,
multiplexed connections between network nodes.
This class implements the superclass' abstract preprocess(Message)
to set the session's context ID as the message's routing key's context ID.
This is necessary to support the multiplexing of virtual sessions across a
single transport queue.
Modifier and Type | Field and Description |
---|---|
private int |
localContextID
The context ID to which this virtual session is registered locally
on this side of the connection.
|
LOG
ADDRESS_REPLY, ADDRESS_REQUEST, BEGIN_REPLY, ECHO, ECHO_REPLY, END_REPLY, INIT_CONVERSATION, INIT_REPLY, INIT_ROUTER, INIT_STANDARD, REPLY_ASYNC, REPLY_EXCEPTION_ASYNC, REPLY_EXCEPTION_SYNC, REPLY_SYNC, REQUEST_ASYNCH, REQUEST_SYNCH, UNKNOWN
Constructor and Description |
---|
VirtualSession(Queue queue,
java.lang.Object context,
int peerID,
int contextID)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) int |
getLocalContextID()
Get the context ID to which the virtual session is registered on this
side.
|
protected void |
preprocess(Message message)
Update the security context ID of the given message to this session's
(peer) context ID, before it is sent.
|
void |
registerSynchronizer(StateSynchronizer sync)
Overrides the parent class' implementation to disallow the registraction
of a state synchronizer.
|
addSessionListener, addSessionListener, cleanupContext, echo, echoReply, end, forward, getContext, getContextID, getException, getNodeAddress, getQueue, getRemoteAddress, isRunning, removeSessionListener, sendInitializationEvent, sendTerminationEvent, setContext, terminate, transact
private int localContextID
VirtualSession(Queue queue, java.lang.Object context, int peerID, int contextID)
queue
- Message transport.context
- Security context. Must not be null
.peerID
- Unique identifier for this session's peer security context on
the other side of the network connection.contextID
- Unique identifier for this session's local security context on
the this side of the network connection.public void registerSynchronizer(StateSynchronizer sync)
registerSynchronizer
in interface Session
registerSynchronizer
in class BaseSession
sync
- The synchronizer to register or null
if the
currently registered synchronizer should be deregistered.java.lang.UnsupportedOperationException
- always.int getLocalContextID()
protected void preprocess(Message message)
preprocess
in class BaseSession
message
- Message to process.