package firstservlet;
import java.util.*;
/**
* <p> Title: </p>
*
* <p> Description: </p>
*
* <p> Copyright: Copyright (c) 2007 </p>
*
* <p> Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class ContextObject {
private List list = new ArrayList();
private MyTimer timer = null;
private boolean isCont = true;
public ContextObject() {
}
public void time() {
Date some = new Date();
list.add(some);
}
public List getTime() {
return list;
}
public void startTimeStamp() {
timer = new MyTimer();
timer.start();
}
public void stopTimeStamp() {
isCont = false;
timer.interrupt();
}
class MyTimer extends Thread {
public void run() {
while (isCont) {
try {
sleep(1000);
} catch (InterruptedException ex) {
interrupt();
break;
}
time();
}
}
}
}
package firstservlet;