I am trying to develop a java program for networking where I require that my object of a class has an associated timer with it……
Then if the specified time run outs I can do different stuff with the object such as retransmitting it or killing it…
What I wanted to ask was is there a timer object that automatically keeps track of the time that has passed after its creation and then gives out an alert for some specified passed out time value …. or is there any method to do such a thing….
Thanks a lot…
In this case, what you really want is not a timer, but a timeout.
The JDK classes for networking are lacking in this area. Have a look at commons-httpclient. It supports this out of the box and should fit your need well.