• Post Reply Bookmark Topic Watch Topic
  • New Topic

Callable implementation  RSS feed

 
kartik krishnan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WE have a web application that calls a helper method in which an anonymous implementation of the Callable Interface is executed. What we have found is that the thread does not terminate. I found out when I tried to run the helper method in eclipse.



What I have found that when the callable returns, it does not return control back to the Java command after this statement.

If anybody knows the answer, please let me know.

Thanks,
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answer to what? This sounds like expected behavior for a thread pool - or more generally, for an ExecutorService. If you want it to shut down when it's done with all the jobs submitted so far, call shutdown(). If you don't call shutdown(), it will remain active, waiting for you to submit new jobs.
[ February 08, 2008: Message edited by: Jim Yingst ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!