This will not work. I assume actionPerformed() will be called repeatedly for 3 times since its 3 retries, and you need to maintain the retrycount somewhere. You cannot declare the retry count also as static since there will be many threads calling this method. If that retaining that retryCount logic is solved the other code is very straight forward.
- Shiva