public final class IntermediateSession extends Object implements MessageHandler, ReplyHandler
Modifier and Type | Method and Description |
---|---|
void |
close()
This method unregisters this session from message bus, effectively disabling any more messages from being
delivered to the message handler.
|
boolean |
destroy()
Sets the destroyed flag to true.
|
void |
forward(Routable routable)
Forwards a routable to the next hop in its route.
|
String |
getConnectionSpec()
Returns the connection spec string for this session.
|
MessageHandler |
getMessageHandler()
Returns the message handler of this session.
|
String |
getName()
Returns the name of this session.
|
ReplyHandler |
getReplyHandler()
Returns the reply handler of this session.
|
void |
handleMessage(Message msg)
This function is called when a message arrives.
|
void |
handleReply(Reply reply)
This function is called when a reply arrives.
|
public boolean destroy()
public void close()
MessageBus.sync()
as to ensure that there are no threads currently entangled in the handler.
This method will deadlock if you call it from the message or reply handler.public void forward(Routable routable)
routable
- the routable to forward.public MessageHandler getMessageHandler()
public ReplyHandler getReplyHandler()
public String getConnectionSpec()
public String getName()
public void handleMessage(Message msg)
MessageHandler
handleMessage
in interface MessageHandler
msg
- The message that arrived.public void handleReply(Reply reply)
ReplyHandler
handleReply
in interface ReplyHandler
reply
- The reply that arrived.Copyright © 2018. All rights reserved.