Interface AsyncEndpointServerSpi
-
public interface AsyncEndpointServerSpiSPI 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
AsyncNodeServernode 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
AsyncNodeServernode and remotely with aAsyncEndpointClientSpiendpoint.- 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 voidsendMessage(MessageDto message)Invoked by theAsyncNodeServernode to send aMessageDtoto 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 theAsyncNodeServernode to send aMessageDtoto 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
MessageDtoto the client.
- Parameters:
message- The message to send.- Since:
- 2.0.0
- Find the opened session using the accessible sessionId value using the method
-
-