com.jfw.scheduler
Class ScheduleBean

java.lang.Object
  extended by com.jfw.scheduler.ScheduleBean
Direct Known Subclasses:
Check4Update, CleanOldFiles, MyCacheSCH, MyProbe, StartupSCH

public abstract class ScheduleBean
extends java.lang.Object

Must be extend by the classes added at scheduler.


Field Summary
protected  java.lang.String className
          Used for logging.
protected  PropertiesManager properties
          Manage file jfw.properties.
 
Constructor Summary
ScheduleBean()
          Create a new instance.
 
Method Summary
protected  void addError(java.lang.String message)
          Add a message error.
 int getAdvance()
          Get value of attribute advance.
protected  void sendEmail(java.lang.String message)
          Send an email.
protected  void setAdvance(int advance)
          Set percent of execution.
abstract  void start()
          Must be implement by sub classses.
 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

className

protected java.lang.String className
Used for logging.


properties

protected PropertiesManager properties
Manage file jfw.properties.

Constructor Detail

ScheduleBean

public ScheduleBean()
Create a new instance.

Method Detail

start

public abstract void start()
                    throws java.lang.Throwable
Must be implement by sub classses. This is the only method called by the instatiater thread. Called in method ScheduleThread.run().

Throws:
java.lang.Throwable

stop

public void stop()
Set attribute toStop at true.


setAdvance

protected void setAdvance(int advance)
Set percent of execution. Must be set in start() method if this info is needed.

Parameters:
advance - a int value between 0 and 100.

getAdvance

public int getAdvance()
Get value of attribute advance.

Returns:
value of attribute advance.

addError

protected void addError(java.lang.String message)
Add a message error. The method is used in start() when an error occurs. Use method ScheduleThread.addError(java.lang.String) to manage the error message.

Parameters:
message - the error message to add.

sendEmail

protected void sendEmail(java.lang.String message)
Send an email. Use method ScheduleThread.sendEmail(java.lang.String) to send the email.

Parameters:
message - the mail message. The to and object of the email are defined in jfw.poperties.