|
Right Java tools for J2EE, Web Service, Grid and more
|
com.acelet.s.scheduler
Class SchedulerControl
java.lang.Object
com.acelet.s.scheduler.SchedulerControl
public class SchedulerControl
- extends java.lang.Object
The SchedulerControl is a utility class for SuperScheduler.
It is used for control schedule
and tasks from Java program, either from EJB or other Java application.
The methods are very simple, powerful and less error prone.
|
Field Summary |
static int |
STATUS_ACTIVE
STATUS_ACTIVE is an int for using as status value. |
static int |
STATUS_SUSPENDED
STATUS_SUSPENDED is an int for using as status value. |
|
Constructor Summary |
SchedulerControl(LogAgent logAgent,
java.sql.Connection taskConnection)
Constructor for SchedulerControl. |
|
Method Summary |
int |
changeTaskStatus(java.lang.String taskName,
int newStatus)
changeTaskStatus changes the status for a Task. |
void |
requestRunTask(java.lang.String taskName)
requestRunTask request SuperScheduler to run the task. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STATUS_ACTIVE
public static final int STATUS_ACTIVE
STATUS_ACTIVE is an int for using as status value.
- See Also:
- Constant Field Values
STATUS_SUSPENDED
public static final int STATUS_SUSPENDED
STATUS_SUSPENDED is an int for using as status value.
- See Also:
- Constant Field Values
SchedulerControl
public SchedulerControl(LogAgent logAgent,
java.sql.Connection taskConnection)
throws java.lang.Exception
- Constructor for
SchedulerControl.
- Parameters:
taskConnection - The connection to task database.
logAgent - The LogAgent.
- Throws:
Exception.
java.lang.Exception- See Also:
It should be set as auto-commit
changeTaskStatus
public int changeTaskStatus(java.lang.String taskName,
int newStatus)
throws java.lang.Exception
changeTaskStatus changes the status for a Task.
- Parameters:
taskName - the name of the Task.newStatus - the new status. It can be
STATUS_ACTIVE or STATUS_SUSPENDED
- Returns:
- the number of rows changed. It is 1, if successful, 0 otherwise.
- Throws:
Exception.
java.lang.Exception
requestRunTask
public void requestRunTask(java.lang.String taskName)
throws java.lang.Exception
requestRunTask request SuperScheduler to run the task.
A Doer will take the request and run the task.
- Parameters:
taskName - the name of the task.
- Throws:
Exception.
java.lang.Exception