In my understanding:
A user polls the future object until the result is available. On the other end, the job is executed synchronously and the result should be stored somewhere until next poll. Where is the result stored?
How does it happen for remote calls i.e., Async SOAP operations? For how long are the results ‘stored’ on server side?
The result is stored in the Future object itself. It’s not stored at server-side.
Thread 1 submits a Callable to an Executor. This executor creates a Runnable which implements Future and which wraps the callable and its future result. It returns this future.
Thread 2 from the executor executes the runnable future. When run, the future executes its wrapped callable, and stores the result of the callable in its result field.
Thread 1 asks the result from the future, and the future returns the result it has stored in its result field.
Look at the source code and documentation of java.util.concurrent.FutureTask.