File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes TaskExecutor.exucute(Runnable) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "TaskExecutor.exucute(Runnable)" Watch "TaskExecutor.exucute(Runnable)" New topic
Author

TaskExecutor.exucute(Runnable)

Rakesh Basani
Ranch Hand

Joined: Jun 04, 2012
Posts: 38
hi guys..

I am stuck with one doubt. In general Threads concept, if we call Thread.start() two times continuously then the second Thread.start() will throw IllegalStateExeception.
In the same way when I call TaskExecutor.execute(Runnable) two times continuously, its not throwing any exception.. Please clarify me..


Thanks in advance.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1680
    
    7

You are comparing an Executor to a Thread. They are not the same.

When calling Thread.start() two times you are trying to start the same thread twice this is not what happens when you call TaskExecutor.execute(Runnable) twice.

Please read the relevant part of the documentation and if that does not clear it up, post back with any questions.

http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/scheduling.html#scheduling-task-executor


[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TaskExecutor.exucute(Runnable)