title: Getting a result in the future?
body: <p>I'm looking to get a result from a method which can take a while to complete and doesn't actually return the object, so I'd like to deal with it as effectively as possible. Here's an example of what I'm trying to achieve:</p>
  
  <pre><code>    public static void main (String[] args) {
          Object obj = someMethod();
  
          System.out.println("The object is" + obj + ", wooh!");
      }
  
      public void callObject() {
          // Sends request for the object
      }
  
      public void receiveObject(Object object) {
          // Received the object
      }
  
      public Object someMethod() {
          callObject();
          // delay whilst the object is being received
          // return received object once received, but how?
      }
  </code></pre>
  
  <p>The method callObject will call to get the object, however a different method is called with the object in. I want someMethod() to be able to call for the object, and then return what it eventually receives, even though the actual call and receive are separate methods.</p>
  
  <p>I've looked into using FutureTasks and Callables which I <em>think</em> is the way forward, I'm just not too sure how to implement it.</p>
  
  <p>Sorry if I didn't explain myself too well, I'll give more information if necessary.</p>
  
  <p>Thanks!</p>