Right Java tools for J2EE, Web Service, Grid and more
|Home | Products | Documents | Downloads | Purchase | Support | Company | Partners | Contact |

com.acelet.s.scheduler
Class SchedulerControl

java.lang.Object
  extended by 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
 

Field Detail

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
Constructor Detail

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
Method Detail

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

Copyright Acelet Corporation. 2000-2008. All rights reserved.