oneway calls
Why do we need one way calls?
When client invoke a remote method this is the sequence of events:
Some time when the response return null and the request acknowledgment is not so important it is desirable to save the network by not sending a response from the server at all.
This is done using the @OneWay
asyncrmi annotation.
when using the @OneWay
annotation on a method
(here is an example)
The sequence diagram should look like that:
It is possible to define one way method that returns a Future<Void>
this means that the
future will be resolved as soon as the clientsocket got the request if the oneway annotation is full @OneWay(full = true)
or after the request was fully sent from the clientsocket if the oneway annotation is not full @OneWay(full = false)
Note that full oneway future will never throws anything while not full oneway future can throw an exception in case the message was not be able to sent to the server. Here are both sequence diagrams:
@OneWay(full = true)
@OneWay(full = false)
The default one way mode for asyncrmi is @OneWay(full = true)
back to index