private class StompBrokerRelayMessageHandler.StompConnectionHandler extends java.lang.Object implements TcpConnectionHandler<byte[]>
Modifier and Type | Field and Description |
---|---|
private StompHeaderAccessor |
connectHeaders |
private boolean |
isRemoteClientSession |
private boolean |
isStompConnected |
private java.lang.String |
sessionId |
private TcpConnection<byte[]> |
tcpConnection |
Modifier | Constructor and Description |
---|---|
private |
StompConnectionHandler(java.lang.String sessionId,
StompHeaderAccessor connectHeaders) |
private |
StompConnectionHandler(java.lang.String sessionId,
StompHeaderAccessor connectHeaders,
boolean isRemoteClientSession) |
Modifier and Type | Method and Description |
---|---|
void |
afterConnected(TcpConnection<byte[]> connection)
Invoked after a connection is successfully established.
|
void |
afterConnectFailure(java.lang.Throwable ex)
Invoked after a connection failure.
|
void |
afterConnectionClosed()
Invoked after the connection is closed.
|
protected void |
afterStompConnected(StompHeaderAccessor connectedHeaders)
Invoked after the STOMP CONNECTED frame is received.
|
void |
clearConnection()
Close the TCP connection to the broker and release the connection reference,
Any exception arising from closing the connection is propagated.
|
ListenableFuture<java.lang.Void> |
forward(Message<?> message) |
java.lang.String |
getSessionId() |
void |
handleMessage(Message<byte[]> message)
Handle a message received from the remote host.
|
protected void |
handleTcpConnectionFailure(java.lang.String errorMessage,
java.lang.Throwable ex)
Invoked when any TCP connectivity issue is detected, i.e.
|
private void |
initHeartbeats(StompHeaderAccessor connectedHeaders) |
protected void |
sendMessageToClient(Message<?> message) |
private void |
sendStompErrorToClient(java.lang.String errorText) |
java.lang.String |
toString() |
private final java.lang.String sessionId
private final boolean isRemoteClientSession
private final StompHeaderAccessor connectHeaders
private volatile TcpConnection<byte[]> tcpConnection
private volatile boolean isStompConnected
private StompConnectionHandler(java.lang.String sessionId, StompHeaderAccessor connectHeaders)
private StompConnectionHandler(java.lang.String sessionId, StompHeaderAccessor connectHeaders, boolean isRemoteClientSession)
public java.lang.String getSessionId()
public void afterConnected(TcpConnection<byte[]> connection)
TcpConnectionHandler
afterConnected
in interface TcpConnectionHandler<byte[]>
connection
- the connectionpublic void afterConnectFailure(java.lang.Throwable ex)
TcpConnectionHandler
afterConnectFailure
in interface TcpConnectionHandler<byte[]>
ex
- the exceptionprotected void handleTcpConnectionFailure(java.lang.String errorMessage, java.lang.Throwable ex)
private void sendStompErrorToClient(java.lang.String errorText)
protected void sendMessageToClient(Message<?> message)
public void handleMessage(Message<byte[]> message)
TcpConnectionHandler
handleMessage
in interface TcpConnectionHandler<byte[]>
message
- the messageprotected void afterStompConnected(StompHeaderAccessor connectedHeaders)
private void initHeartbeats(StompHeaderAccessor connectedHeaders)
public void afterConnectionClosed()
TcpConnectionHandler
afterConnectionClosed
in interface TcpConnectionHandler<byte[]>
public ListenableFuture<java.lang.Void> forward(Message<?> message)
public void clearConnection()
If the connection belongs to a client session, the connection handler
for the session (basically the current instance) is also released from the
StompBrokerRelayMessageHandler
.
public java.lang.String toString()
toString
in class java.lang.Object