@DeclareRoles(value="org.imixs.ACCESSLEVEL.MANAGERACCESS") @RunAs(value="org.imixs.ACCESSLEVEL.MANAGERACCESS") public class SchedulerService extends Object
A scheduler definition is stored in a document with the type "scheduler". The document can provide concrete information to process the timer event.
The TimerService can be started using the method start(). The Methods findTimerDescription and findAllTimerDescriptions are used to lookup enabled and running service instances.
Each Method expects or generates a TimerDescription Object. This object is an instance of a ItemCollection. To create a new timer the ItemCollection should contain the following attributes:
the following additional attributes are generated by the finder methods and can be used by an application to verfiy the status of a running instance:
| Modifier and Type | Field and Description |
|---|---|
static String |
DOCUMENT_TYPE |
| Constructor and Description |
|---|
SchedulerService() |
| Modifier and Type | Method and Description |
|---|---|
javax.ejb.Timer |
findTimer(String id)
This method returns a timer for a corresponding id if such a timer object
exists.
|
ItemCollection |
loadConfiguration(String name)
Loads the scheduler configuration entity by name.
|
ItemCollection |
saveConfiguration(ItemCollection configItemCollection)
This method saves the scheduler configuration.
|
ItemCollection |
start(ItemCollection configuration)
Starts a new Timer for the scheduler defined by the Configuration.
|
void |
startAllSchedulers()
This method will start all schedulers which are not yet started.
|
ItemCollection |
stop(ItemCollection configuration)
Cancels a running timer instance.
|
ItemCollection |
stop(ItemCollection configuration,
javax.ejb.Timer timer) |
void |
updateTimerDetails(ItemCollection configuration)
Updates the timer details of a running timer service.
|
public static final String DOCUMENT_TYPE
public ItemCollection loadConfiguration(String name)
public ItemCollection saveConfiguration(ItemCollection configItemCollection)
AccessDeniedExceptionpublic ItemCollection start(ItemCollection configuration) throws AccessDeniedException, ParseException
The Timer can be started based on a Calendar setting stored in the property _scheduler_definition.
The $UniqueID of the configuration entity is the id of the timer to be controlled.
The method throws an exception if the configuration entity contains invalid attributes or values.
After the timer was started the configuration is updated with the latest statusmessage. The item _schedueler_enabled will be set to 'true'.
The method returns the updated configuration. The configuration will not be saved!
configuration - - scheduler configurationAccessDeniedExceptionParseExceptionpublic ItemCollection stop(ItemCollection configuration)
The method returns the current configuration. The configuration will not be saved!
public ItemCollection stop(ItemCollection configuration, javax.ejb.Timer timer)
public void startAllSchedulers()
public javax.ejb.Timer findTimer(String id)
id - Exceptionpublic void updateTimerDetails(ItemCollection configuration)
configuration - - the current scheduler configuration to be updated.Copyright © 2006–2019 Imixs Software Solutions GmbH. All rights reserved.