|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.services.StandardManager
wt.scheduler.StandardSchedulingService
Standard implementation of the scheduling service. Contains an implementation of the client and server APIs.
Use the newStandardSchedulingService
static factory method(s),
not the StandardSchedulingService
constructor, to construct
instances of this class. Instances must be constructed using the static
factory(s), in order to ensure proper initialization of the instance.
Supported API: false
Extendable: false
Nested Class Summary | |
(package private) static class |
StandardSchedulingService.ScheduleHistoryPurging
Class for thread spawning of ScheduleHistoryPurging. In order to enable threading mechanism, verify spawnScheduleHistoryPurging method. |
(package private) class |
StandardSchedulingService.SchedulerEventListener
|
(package private) class |
StandardSchedulingService.SchedulerMultiObjectEventListener
|
Field Summary | |
private static String |
CLASSNAME
|
private static boolean |
DEBUG_FULL_INFO
|
private static int |
DELAY_QUEUE_ENTRY_EXEC
|
private static ScheduleItem |
g_scheduledHistoryPurging
|
private static int |
HISTORY_PURGING_QUERY_SIZE
|
private static boolean |
HISTORY_PURGING_USING_THREAD
|
private static int |
LOCK_RETRY_TIMES
|
private static int |
LOCK_TIMEOUT
|
private static boolean |
PURGE_EXECUTING_HISTORIES
|
private static String |
PURGE_HISTORY_SCHEDULE_ITEM_NAME
|
private static boolean |
PURGE_INTERVAL_IN_SECONDS
|
private static int |
PURGE_OLD_HISTORY_INTERVAL
|
private static boolean |
PURGE_OLD_HISTORY_ITEMS
|
private static int |
PURGE_OLD_HISTORY_OLDER_THAN
|
private static String |
PURGE_SCHEDULE_HISTORY_QUEUE_NAME
|
private static String |
REGULAR_EXECUTION_METHOD
|
private static String |
RESOURCE
|
private static long |
SLEEP_PURGING_THREAD
|
private static boolean |
VERBOSE
|
Fields inherited from class wt.services.StandardManager |
|
Fields inherited from interface wt.services.Manager |
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE |
Constructor Summary | |
StandardSchedulingService()
|
Method Summary | |
int |
abortExecutingItems(ScheduleItem item)
Aborts all running (executing) and ready items associated with the provided ScheduleItem. |
private static ScheduleItem |
activateScheduleHistoryPurging()
Adds the History purging process to the queue. |
private static ScheduleQueueEntry |
addEntryToQueue(ScheduleItem scheduleItem,
String method)
|
ScheduleItem |
addItem(ScheduleItem newItem,
ScheduleMethodArg[] itemArgs)
This adds a ScheduleItem to the system. |
static ScheduleItem |
addItemUnique(ScheduleItem newItem,
ScheduleMethodArg[] itemArgs,
String host)
Adds a ScheduleItem to the Scheduler making sure no other equal item is already into the scheduler in that specific host. If a Schedule Item with same name in the same queue already exists, it's returned instead, therefore this method can be used to retrieve an existing item. Please note this method does NOT modify an existing item. |
private boolean |
cancelHistoryPurging()
Cancels History Purging process. |
void |
cancelItem(ScheduleItem theItem)
Cancels a schedule item. |
private static Timestamp |
computeNextTime(ScheduleItem item)
|
private static void |
createScheduleHistory(ScheduleItem scheduleItem)
|
ScheduleItem |
executeItemImmediately(ScheduleItem item)
Executes an existing Schedule Item immediately. If item doesn't exist, it raises WTException. |
static StatusInfo |
executeScheduledItem(ObjectIdentifier scheduleItemOID)
Given an object ID of a ScheduleItem, invoke its method. |
private static StatusInfo |
executionKernel(ObjectIdentifier scheduleItemOID,
boolean adjustNextTime)
This is the method that actually executes the items. An inner level of abstraction provided. |
String |
getConceptualClassname()
Deprecated. |
Enumeration |
getItemHistories(ScheduleItem theItem)
Returns an enumeration containing all the history items for a given schedule item. |
Enumeration |
getItemMethodArgs(ScheduleItem theItem)
Returns an Enumeration of the ScheduleMethodArgs referred to by the argument ScheduleItem. |
MethodArgument[] |
getItemMethodArguments(ScheduleItem theItem)
Supported API: false |
protected WTCollection |
getItemsHistories(WTCollection items)
Returns a WTCollection containing all the history items for a given schedule items WTCollection. |
protected WTCollection |
getItemsMethodArgs(WTCollection items)
Returns a WTCollection of the ScheduleMethodArgs referred to by the ScheduleItem objects in argiment WTCollection items. |
Enumeration |
getScheduleItems(QuerySpec filter)
Returns schedule items which satisfy the query spec. |
ScheduleItem |
modifyItem(ScheduleItem theItem)
Supported API: false |
static StandardSchedulingService |
newStandardSchedulingService()
Default factory for the class. |
protected void |
performStartupProcess()
Supported API: false |
static long |
purgeOldHistories(Long secondsBack,
Boolean deleteExecuting)
Delete old entries from ScheduleHistory. |
void |
registerEvents(ManagerService manager)
Supported API: false |
void |
removeItem(ScheduleItem item)
Removes a Schedule item Supported API: false |
boolean |
removeMethodFromScheduleQueue(ScheduleItem schedItem)
Eliminates method from ScheduleQueueEntry associated with the specific ScheduleItem. |
static ScheduleItem |
retrieveScheduleItem(String itemName,
String schedQueue)
Retrieves a Schedule Item according to its name and queue. Note: there can be more than one existing item. |
static void |
setNextTime(ScheduleItem item,
Timestamp nextTime)
Sets the next time of execution for a given schedule item. |
private static ScheduleQueueEntry |
setQueueEntryExecutionTime(ScheduleItem item,
Timestamp nextTime)
Sets an existing Schedule Queue entry execution time. It makes sure the Queue gets awaken and executes the item properly. |
private void |
spawnScheduleHistoryPurging(boolean bPurge)
Spawns process for running Schedule History Purging. It can be through threading or direct call (see HISTORY_PURGING_USING_THREAD attribute). |
void |
startExecution(ScheduleItem item)
Supported API: false |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private static boolean VERBOSE
private static boolean DEBUG_FULL_INFO
private static final String REGULAR_EXECUTION_METHOD
private static final int LOCK_TIMEOUT
private static int LOCK_RETRY_TIMES
private static final int DELAY_QUEUE_ENTRY_EXEC
private static final boolean HISTORY_PURGING_USING_THREAD
private static boolean PURGE_OLD_HISTORY_ITEMS
private static boolean PURGE_EXECUTING_HISTORIES
private static int PURGE_OLD_HISTORY_OLDER_THAN
private static int PURGE_OLD_HISTORY_INTERVAL
private static boolean PURGE_INTERVAL_IN_SECONDS
private static ScheduleItem g_scheduledHistoryPurging
private static final int HISTORY_PURGING_QUERY_SIZE
private static final String PURGE_HISTORY_SCHEDULE_ITEM_NAME
private static final String PURGE_SCHEDULE_HISTORY_QUEUE_NAME
private static final long SLEEP_PURGING_THREAD
Constructor Detail |
public StandardSchedulingService()
Method Detail |
public String getConceptualClassname()
getConceptualClassname
in interface NetFactor
getConceptualClassname
in class StandardManager
protected void performStartupProcess()
performStartupProcess
in class StandardManager
public void registerEvents(ManagerService manager)
registerEvents
in interface Manager
registerEvents
in class StandardManager
manager
- public static StatusInfo executeScheduledItem(ObjectIdentifier scheduleItemOID)
scheduleItemOID
-
public static StandardSchedulingService newStandardSchedulingService() throws WTException
WTException
public Enumeration getScheduleItems(QuerySpec filter) throws WTException
getScheduleItems
in interface SchedulingService
filter
-
WTException
public ScheduleItem addItem(ScheduleItem newItem, ScheduleMethodArg[] itemArgs) throws WTException
addItem
in interface SchedulingService
newItem
- itemArgs
-
WTException
public void cancelItem(ScheduleItem theItem) throws WTException
cancelItem
in interface SchedulingService
theItem
-
WTException
public ScheduleItem modifyItem(ScheduleItem theItem) throws WTException
modifyItem
in interface SchedulingService
theItem
-
WTException
public void startExecution(ScheduleItem item) throws WTException
startExecution
in interface SchedulingService
item
-
WTException
public MethodArgument[] getItemMethodArguments(ScheduleItem theItem) throws WTException
getItemMethodArguments
in interface SchedulingService
theItem
-
WTException
public Enumeration getItemMethodArgs(ScheduleItem theItem) throws WTException
getItemMethodArgs
in interface SchedulingService
theItem
-
WTException
public Enumeration getItemHistories(ScheduleItem theItem) throws WTException
getItemHistories
in interface SchedulingService
theItem
-
WTException
public void removeItem(ScheduleItem item) throws WTException
removeItem
in interface SchedulingService
item
-
WTException
public ScheduleItem executeItemImmediately(ScheduleItem item) throws WTException
executeItemImmediately
in interface SchedulingService
item
-
WTException
protected WTCollection getItemsHistories(WTCollection items) throws WTException
items
- Collection of ScheduleItem objects
WTException
protected WTCollection getItemsMethodArgs(WTCollection items) throws WTException
items
- Collection of ScheduleItem objects
WTException
private static StatusInfo executionKernel(ObjectIdentifier scheduleItemOID, boolean adjustNextTime)
scheduleItemOID
- ObjectIdentifier of the Schdule item to be executedadjustNextTime
- boolean signalizing if it modifies or not item next time of executionprivate static ScheduleQueueEntry addEntryToQueue(ScheduleItem scheduleItem, String method) throws WTException
WTException
private static void createScheduleHistory(ScheduleItem scheduleItem) throws WTException
WTException
private static Timestamp computeNextTime(ScheduleItem item)
public static ScheduleItem addItemUnique(ScheduleItem newItem, ScheduleMethodArg[] itemArgs, String host) throws WTException
false
newItem
- schedule item to be inserted into the SystemitemArgs
- method arguments of schedule itemhost
- name of host of the schedule queueWTException
private static ScheduleQueueEntry setQueueEntryExecutionTime(ScheduleItem item, Timestamp nextTime) throws WTException
item
- Schedule item whose Queue entry will be modifiednextTime
- Timstamp with execution time to be set
WTException
public static void setNextTime(ScheduleItem item, Timestamp nextTime)
false
item
- schedule item to have the next executing time modifiednextTime
- next executing time.
If parameter null, sets current timepublic static ScheduleItem retrieveScheduleItem(String itemName, String schedQueue)
itemName
- Schedule item name to look forschedQueue
- name of the Queue of the item
public int abortExecutingItems(ScheduleItem item) throws WTException
item
- the ScheduleItem to look for associated queue items
WTException
- If problems occur during operation.public boolean removeMethodFromScheduleQueue(ScheduleItem schedItem)
schedItem
- the ScheduleItem to look for associated methods in the queue
private void spawnScheduleHistoryPurging(boolean bPurge)
private static ScheduleItem activateScheduleHistoryPurging()
private boolean cancelHistoryPurging()
public static long purgeOldHistories(Long secondsBack, Boolean deleteExecuting)
secondsBack
- number of seconds back, before that time, items are deleted.deleteExecuting
- if also deletes Executing items.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |