i have to design polling in java, which keeps executing at certain interval.
How to deign this polling in java. I can use only java se.
I have to use this class in jboss environment and when server starts running this class should get loaded into memory and till the time server is up it should keep polling.
In addition to what Tim said, you can also look at Quartz.
You can use a framework to ease your job. One I have used in a project for a government agency here in Brazil is DWR. It is essentially a Reverse Ajax framework (which you should use instead of polling, if possible). It can also work in polling mode. Please take a look here for more details.
Kumar Gaurav wrote:How to deign this polling in java. I can use only java se.
Is this a school exercise? Otherwise the restrictions seems quite artificial (and arbitrary) to me.
For example, on Unix this could probably be done by a single entry in a crontab. No programming needed whatsoever. I believe Windows also has a built-in scheduler.
Winston
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here