Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

properties re-added

  • Loading branch information...
commit efa03557f01467b42f4de9b3849d5572125e3d93 1 parent 1ea49bd
@drag0sd0g authored
Showing with 68 additions and 0 deletions.
  1. +68 −0 src/main/resources/FutureCodeProperties
View
68 src/main/resources/FutureCodeProperties
@@ -0,0 +1,68 @@
+initialCode=<br>// Future objects are returned on submit to ExecutorService<br> \
+ // or can be created by constructing a FutureTask.<br> \
+ <br> \
+ // The Future.get() method blocks<br> \
+ // until some result is available.<br> \
+ <br> \
+ final Future future =<br> \
+ Executors.newCachedThreadPool().submit(someCallable); <br><br> \
+ // OR<br> \
+ <br> \
+ FutureTask&lt;Callable&gt; future = new FutureTask&lt;Callable&gt;(someCallable);<br> \
+ Thread thread = new Thread(futureTask);<br> \
+ thread.start();<br> \
+ <br><br><br> \
+ // Finally, the Future task completes<br> \
+ // and the block passes through.<br> \
+ Object result = future.get();
+startExecutionBoldCode=<br>// Future objects are returned on submit to ExecutorService<br> \
+ // or can be created by constructing a FutureTask.<br> \
+ <br> \
+ // The Future.get() method blocks<br> \
+ // until some result is available.<br> \
+ <br> \
+ <b> final Future future =<br> \
+ Executors.newCachedThreadPool().submit(someCallable);</b> <br><br> \
+ // OR<br> \
+ <br> \
+ <b>FutureTask&lt;Callable&gt; future = new FutureTask&lt;Callable&gt;(someCallable);<br> \
+ Thread thread = new Thread(futureTask);<br> \
+ thread.start();</b><br> \
+ <br><br><br> \
+ // Finally, the Future task completes<br> \
+ // and the block passes through.<br> \
+ Object result = future.get();
+waitForResultCode=<br>// Future objects are returned on submit to ExecutorService<br> \
+ // or can be created by constructing a FutureTask.<br> \
+ <br> \
+ // The Future.get() method blocks<br> \
+ // until some result is available.<br> \
+ <br> \
+ <b> final Future future =<br> \
+ Executors.newCachedThreadPool().submit(someCallable);</b> <br><br> \
+ // OR<br> \
+ <br> \
+ <b>FutureTask&lt;Callable&gt; future = new FutureTask&lt;Callable&gt;(someCallable);<br> \
+ Thread thread = new Thread(futureTask);<br> \
+ thread.start();</b><br> \
+ <br><br><br> \
+ // Finally, the Future task completes<br> \
+ // and the block passes through.<br> \
+ <blink><font color="red"> Object result = future.get();</font></blink>
+getFutureCode=<br>// Future objects are returned on submit to ExecutorService<br> \
+ // or can be created by constructing a FutureTask.<br> \
+ <br> \
+ // The Future.get() method blocks<br> \
+ // until some result is available.<br> \
+ <br> \
+ final Future future =<br> \
+ Executors.newCachedThreadPool().submit(someCallable); <br><br> \
+ // OR<br> \
+ <br> \
+ FutureTask&lt;Callable&gt; future = new FutureTask&lt;Callable&gt;(someCallable);<br> \
+ Thread thread = new Thread(futureTask);<br> \
+ thread.start();<br> \
+ <br><br><br> \
+ // Finally, the Future task completes<br> \
+ // and the block passes through.<br> \
+ <b> Object result = future.get();</b>
Please sign in to comment.
Something went wrong with that request. Please try again.