} catch (Exception e) {
// Report the error using the appropriate name and ID.
errors.add("name", new ActionError("id"));
}
// If a message is required, save the specified key(s)
// into the request for use by the <
struts:errors> tag.
if (!errors.isEmpty()) {
saveErrors(request, errors);
// Forward control to the appropriate 'failure' URI (change name as desired)
//forward = mapping.findForward("failure");
} else {
// Forward control to the appropriate 'success' URI (change name as desired)
// forward = mapping.findForward("success");
}
// Finish with
return mapping.findForward("success");
}
}
here is my sheduler
public class SheduleQueue {
static LinkedList queuelist = new LinkedList();
queue que = new queue();
// timer
int delay = 5000; // delay for 5 sec.
int period = 1000; // repeat every sec.
Timer timer = new Timer();
BuildStatusAction statusform = new BuildStatusAction();
// Add Build to the build queue
public synchronized void addBuild(Object key ,Object value) {
queuelist.addLast(o);
}
// Retrieve build from the build queue; block if the queue is empty
public synchronized void addsheduledjob() throws InterruptedException {
timer.schedule( new TimerTask() {
public void run() {
// Task here ...
// here i have to create instance of Queue and
// QueueImpl else the jobs are being added to queue but are //not being executed
// Queue addtoqueue = new Queue();
// QueueImpl queim = new QueueImpl(addtoqueue);
//queim.start();
// add job to queueat sheduled time
que.addBuild("job");
}
}, delay);
// delete the value from list once it is added to queue
}
}[/code]
sorry i was not aware of code tags earlier i added them now .
thanks for the responces
in shdeuleaction class i started the thread of QueueImpl class .when i am adding jobs from sheduleQueue to this que ..then the current thread suppose to take the job in the que but the jobs are remaining in queue with out run by QueueImpl ..i have to start the thread again in the shedule Queue ?