Interface AsyncEndpointServerSpi
-
public interface AsyncEndpointServerSpi
SPI of the server endpoint using an asynchronous network protocol.You must provide an implementation of this interface if you plan to use a full duplex communication protocol, such as Web Sockets for example.
Following the receive of a message from the client, the endpoint must :
- Associate the session with the the accessible sessionId value using the method
MessageDto.getSessionId()
on the received message in order to be able to retrieve the session later. - Retrieve the
AsyncNodeServer
node using the getAsyncNode() method of the associated distributed component, depending on your use case. - Invoke the method
AsyncNodeServer.onMessage(MessageDto)
on the node. - Invoke the method
AsyncNodeServer.onClose(String)
on the node after the session closing.
This endpoint interacts locally with a
AsyncNodeServer
node and remotely with aAsyncEndpointClientSpi
endpoint.- Since:
- 2.0.0
- Associate the session with the the accessible sessionId value using the method
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
sendMessage(MessageDto message)
Invoked by theAsyncNodeServer
node to send aMessageDto
to the client.
You have to : Find the opened session using the accessible sessionId value using the methodMessageDto.getSessionId()
on the provided message to send.
-
-
-
Method Detail
-
sendMessage
void sendMessage(MessageDto message)
Invoked by theAsyncNodeServer
node to send aMessageDto
to the client.
You have to :- Find the opened session using the accessible sessionId value using the method
MessageDto.getSessionId()
on the provided message to send. - Serialize and send the
MessageDto
to the client.
- Parameters:
message
- The message to send.- Since:
- 2.0.0
- Find the opened session using the accessible sessionId value using the method
-
-