tags:

views:

76

answers:

1

Hi

I have application packaged into .jar file on windows server. I want this application to run every 3 seconds. how can I achieve this?

I was planning to write shell script on linux server, remotely log into windows server and execute .jar file but the problem is windows server and linux server are on different VLANs which have been prevented from communicating. so i couldn't even test if my silution is working.

your urgent help please. this has to be delivered before end of business tomorrow

A: 

Windows should have an scheduler, doesn´t it??

Whatever, you can add a code in your jar to make it execute what you want evey 3 secods. You can do in about 2 lines. Timer timer = new Timer(); timer.scheduleAtFixedRate(new MyTimer(), 3000, 3000); and let it running... the MyTimer class has to extend TimerTask (and implement run method). Put the stuff u want your program to do in the run method. It could also start the other jar file you want

fredcrs