axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bethana kumar <>
Subject java reminders how
Date Thu, 16 Sep 2004 14:40:53 GMT

Dear All

I have the following requirements.I need your suggestions for implementing.

I have an webbased system,in which enduser creates a case about an employee and assign this
to Inspector for inspection.

Inspector login to webbased system then he schedules this inspection for 30 days.

Now we have to develop a sytem which will send an email to Inspector one week before scheduled
day(i.e 23rd day) depending of inspection case status.

All the inspection details will be available in Oracle database.

Framework used by us are JBoss 3.1.5 with tomcat and struts along with oracle database.


Currently I am following design


I have an Timer class (i.e java.util.Timer) which will be initiated at Jboss Startup(i.e Servlet
will call this class at its init() method),the Timer Class schedule a task (i.e RemindTask).

import java.util.*;

public class Reminder {

Timer timer;

Calendar StartingTime=null;

//send reminders once in a day

private static final long DEFAULT_INTERVAL = 1000 * 60 * 60 * 24;

public Reminder() {

timer = new Timer();

StartingTime = Calendar.getInstance();

// Starting at 7:00 AM in the Morning 





timer.schedule(new RemindTask(), StartingTime.getTime(),DEFAULT_INTERVAL);


class RemindTask extends TimerTask {

public void run() {

System.out.println(" run()!");



public void doPrcoess()


System.out.println("I have to start prcoess() ");

//Here i am planning to get data from Oracle for the currentday and do some business process

//then i will send an email



public static void main(String args[]) {

System.out.println("About to schedule task.");

new Reminder();

System.out.println("Task scheduled.");




Now my questions are

1)Is it a good design by considering Database accesses and Threads(i.e it should not resource
hungry application)


I really need you guys intelligent idea to how implement the case on the server in java.

Framework used by us are JBoss 3.1.5 with tomcat and struts along with oracle database.







Do you Yahoo!? - Register online to vote today!
View raw message