About Question enthuware.ocejws.v6.2.278 :
Posted: Wed Dec 30, 2015 7:06 am
Why do you cast Future<?> .get() ? You cast it in enthuware.ocejws.v6.2.277 as well. In the explanation you argue against it:
"Client code should not attempt to cast the object to any particular type as this will result in non-portable behavior."
The Dispatch API is even more restrictive:
"This object MUST NOT be used to try to obtain the results of the operation"
https://docs.oracle.com/javaee/6/api/ja ... ncHandler)
How to get back the response from a callback? Do we really need it outside of it?
I think we don't. All the response handling should be done in the callback method.
Future<?> should be used only for polling scenarios.
"Client code should not attempt to cast the object to any particular type as this will result in non-portable behavior."
The Dispatch API is even more restrictive:
"This object MUST NOT be used to try to obtain the results of the operation"
https://docs.oracle.com/javaee/6/api/ja ... ncHandler)
How to get back the response from a callback? Do we really need it outside of it?
I think we don't. All the response handling should be done in the callback method.
Future<?> should be used only for polling scenarios.