I have a stand-alone spring batch application, and I am trying to test the behavior of graceful shutdown by using @PreDestroy feature. I see that the application waits for all current processes to complete once I shutdown the application. The only exception is a poller thread and it dies halfway although the @Predestroy method is being invoked in that class. My poller thread simply implements Runnable interface. I have put a short sleep in the run method and placed a log statement before and after the sleep. While it is sleeping I have the killed the process, it never resumes the statement after the sleep statement.
Ideally, I was hoping the application will not shutdown until the thread completes it business. Please help to to resolve this issue.