com.jfw.scheduler
Class ScheduleThread

java.lang.Object
  extended by com.jfw.scheduler.ScheduleThread
All Implemented Interfaces:
java.lang.Runnable

public final class ScheduleThread
extends java.lang.Object
implements java.lang.Runnable

For every class in scheduling an instance of this class is created. The class to execute is set in the constructor.
The classes to schedule are defined in jfw.properties, key scheduled_objects.


Field Summary
static java.lang.String TYPE_DAILY
          Frequence type for Daily scheduled beans.
static java.lang.String TYPE_MONTHLY
          Frequence type for Monthly scheduled beans.
static java.lang.String TYPE_PERIOD
          Frequence type for Period scheduled beans.
static java.lang.String TYPE_STARTUP
          Frequence type for Startup scheduled beans.
static java.lang.String TYPE_WEEKLY
          Frequence type for Weekly scheduled beans.
 
Method Summary
 java.util.ArrayList getErrors()
          Get a clone of attribute errors.
 java.lang.String getScheduleBean()
          Get attribute scheduleBean.
 void run()
          Thread implementation.
protected  void sendEmail(java.lang.String text)
          Send an error email.
 void stop()
          Set attribute toStop at true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_STARTUP

public static final java.lang.String TYPE_STARTUP
Frequence type for Startup scheduled beans.

See Also:
Constant Field Values

TYPE_PERIOD

public static final java.lang.String TYPE_PERIOD
Frequence type for Period scheduled beans.

See Also:
Constant Field Values

TYPE_DAILY

public static final java.lang.String TYPE_DAILY
Frequence type for Daily scheduled beans.

See Also:
Constant Field Values

TYPE_WEEKLY

public static final java.lang.String TYPE_WEEKLY
Frequence type for Weekly scheduled beans.

See Also:
Constant Field Values

TYPE_MONTHLY

public static final java.lang.String TYPE_MONTHLY
Frequence type for Monthly scheduled beans.

See Also:
Constant Field Values
Method Detail

getScheduleBean

public java.lang.String getScheduleBean()
Get attribute scheduleBean.

Returns:
attribute scheduleBean.

run

public void run()
Thread implementation. Thread is alive until attribute toStop is false. Before the scheduled bean is execute the method ScheduleTypes.sleep() is execute.
If during schedule bean execution an error occurs then an error message it is added in errors but this will not stop the schedule bean execution the next time.

Specified by:
run in interface java.lang.Runnable

stop

public void stop()
Set attribute toStop at true.


getErrors

public java.util.ArrayList getErrors()
Get a clone of attribute errors.

Returns:
a clone of attribute errors.

sendEmail

protected void sendEmail(java.lang.String text)
Send an error email. Use the default parameters of mail server from jfw.properties.

Parameters:
text - text of email.