Package org.eclipse.keyple.distributed
Interface AsyncNodeServer
-
public interface AsyncNodeServer
API of the Node associated to a server endpoint using an asynchronous network protocol.You must bind this kind of node on the server's side if you plan to use a full duplex communication protocol, such as Web Sockets for example.
Then, you must provide an implementation of the
AsyncEndpointServerSpi
SPI in order to interact with this node.Keyple provides its own implementations of this interface and manages their lifecycle.
This kind of node can be bind to a all server remote plugins and local services :RemotePluginServer
LocalServiceServer
Then, you can access it everywhere on the server's side using the getAsyncNode() method of the associated above distributed component.- Since:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onClose(java.lang.String sessionId)
Must be invoked by theAsyncEndpointServerSpi
endpoint following the closing of a communication session with the client.void
onError(java.lang.String sessionId, java.lang.Throwable error)
Must be invoked by theAsyncEndpointServerSpi
endpoint if a technical error occurs when sending a message to the client.void
onMessage(MessageDto message)
Must be invoked by theAsyncEndpointServerSpi
endpoint following the reception and deserialization of aMessageDto
from the client.
-
-
-
Method Detail
-
onMessage
void onMessage(MessageDto message)
Must be invoked by theAsyncEndpointServerSpi
endpoint following the reception and deserialization of aMessageDto
from the client.- Parameters:
message
- The message to process.- Since:
- 2.0.0
-
onClose
void onClose(java.lang.String sessionId)
Must be invoked by theAsyncEndpointServerSpi
endpoint following the closing of a communication session with the client.- Parameters:
sessionId
- The session id registered during the session opening process.- Since:
- 2.0.0
-
onError
void onError(java.lang.String sessionId, java.lang.Throwable error)
Must be invoked by theAsyncEndpointServerSpi
endpoint if a technical error occurs when sending a message to the client.- Parameters:
sessionId
- The session id register during the session opening process.error
- The unexpected error.- Since:
- 2.0.0
-
-