|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.service.scheduler.Scheduler
public class Scheduler
A Scheduler keeps track of ScheduledJobs and executes those jobs according to their Schedules. The Scheduler is run by a single Thread that sleeps until the next job is to be run.
This implementation of Scheduler keeps a list of all of its ScheduledJobs, sorted by next time of occurrence. The Scheduler also keeps a list of "unscheduled" jobs that cannot calculate their next times of occurrence. Every morning at midnight, the Scheduler walks through the "unscheduled" list to see if any jobs can now determine their next occurrence time and therefore be added to the "scheduled" list.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
Scheduler()
Constructs a blank new Scheduler |
Method Summary | |
---|---|
int |
addScheduledJob(ScheduledJob pJob)
Adds the specified ScheduledJob to the Scheduler. |
protected javax.servlet.Servlet |
createAdminServlet()
Creates and returns a new Servlet that will administer this service. |
void |
doStartService()
This will start the thread running |
void |
doStopService()
This will stop the scheduler thread |
ScheduledJob |
findScheduledJob(int pJobId)
Returns the ScheduledJob associated with the given id, or null if there is none. |
int |
getJobCount()
Returns the total number of jobs waiting to occur or to be scheduled. |
int |
getJobOccurrenceCount()
Returns the number jobs that have occurred. |
long |
getLastDelayAmount()
|
long |
getLastDelayEndTime()
|
long |
getLastDelayStartTime()
|
long |
getNextTime()
Returns the time of the next task to be executed, or midnight tomorrow morning, whichever comes first. |
java.lang.String |
getNextTimeFormatted()
|
java.lang.String |
getPerformanceMonitorOpName()
|
int |
getScheduledJobCount()
Returns the number of ScheduledJobs waiting to occur. |
javax.transaction.TransactionManager |
getTransactionManager()
|
boolean |
getTransactionsEnabled()
|
java.lang.String |
getTransAttribute()
|
int |
getTransAttributeCode()
|
int |
getUnscheduledJobCount()
Returns the number of UnscheduledJobs waiting to occur. |
ScheduledJob[] |
getUnscheduledJobs()
|
boolean |
isPerformanceMonitorEnabled()
|
int |
parseTransAttribute(java.lang.String pTransAttribute)
Returns the transaction attribute code for the given trans attribute string. |
void |
removeScheduledJob(int pJobId)
Removes the ScheduledJob with the given id. |
void |
setLastDelayAmount(long pLastDelayAmount)
|
void |
setLastDelayEndTime(long pLastDelayEndTime)
|
void |
setLastDelayStartTime(long pLastDelayStartTime)
|
void |
setPerformanceMonitorEnabled(boolean pPerformanceMonitorEnabled)
|
void |
setPerformanceMonitorOpName(java.lang.String pPerformanceMonitorOpName)
|
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
|
void |
setTransactionsEnabled(boolean pTransactionsEnabled)
|
void |
setTransAttribute(java.lang.String pTransAttribute)
The transaction attribute that should be used on every job - must be one of "required", "requiresNew", "supports", "notSupported", "mandatory", "never". |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public Scheduler()
Method Detail |
---|
public long getLastDelayStartTime()
public void setLastDelayStartTime(long pLastDelayStartTime)
public long getLastDelayEndTime()
public void setLastDelayEndTime(long pLastDelayEndTime)
public long getLastDelayAmount()
public void setLastDelayAmount(long pLastDelayAmount)
public javax.transaction.TransactionManager getTransactionManager()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public boolean getTransactionsEnabled()
public void setTransactionsEnabled(boolean pTransactionsEnabled)
public java.lang.String getTransAttribute()
public void setTransAttribute(java.lang.String pTransAttribute)
public int getTransAttributeCode()
public boolean isPerformanceMonitorEnabled()
public void setPerformanceMonitorEnabled(boolean pPerformanceMonitorEnabled)
public java.lang.String getPerformanceMonitorOpName()
public void setPerformanceMonitorOpName(java.lang.String pPerformanceMonitorOpName)
public ScheduledJob[] getUnscheduledJobs()
public int addScheduledJob(ScheduledJob pJob)
public ScheduledJob findScheduledJob(int pJobId)
public void removeScheduledJob(int pJobId)
public int getJobOccurrenceCount()
public int getScheduledJobCount()
public int getUnscheduledJobCount()
public int getJobCount()
public long getNextTime()
public java.lang.String getNextTimeFormatted()
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic void doStopService()
doStopService
in class GenericService
public int parseTransAttribute(java.lang.String pTransAttribute) throws ServiceException
ServiceException
protected javax.servlet.Servlet createAdminServlet()
createAdminServlet
in class GenericService
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |