Class SchedulerService
java.lang.Object
org.imixs.archive.export.services.SchedulerService
The SchedulerService is responsible to run a EJB Timer service and pull
Export EventLog entries periodically. The service class runs a non-persistent
TimerService based on the given scheduler configuration.
The service automatically starts during deployment.
The scheduler configuration is based on the chron format. E.g:
hour=*;minute=30;
- Version:
- 1.0
- Author:
- rsoika
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit()voidonTimeout(jakarta.ejb.Timer _timer) This is the method which processes the timeout event depending on the running timer settings.List<org.imixs.workflow.FileData>pullFileDataList(org.imixs.workflow.ItemCollection eventLogEntry, org.imixs.melman.DocumentClient documentClient, org.imixs.melman.EventLogClient eventLogClient) This method loads a snapshot from the workflow instance based on a eventLog entry.voidreleaseDeadLocks(org.imixs.melman.EventLogClient eventLogClient) Asynchronous method to release dead locksvoidStops and restarts the timer.voidstartScheduler(boolean clearLog) This method initializes the scheduler.booleanThis method stops the scheduler.
-
Field Details
-
SNAPSHOTID
-
-
Constructor Details
-
SchedulerService
public SchedulerService()
-
-
Method Details
-
init
@PostConstruct public void init() -
onTimeout
@Counted(name="executions", description="Counting the invocations of export service", displayName="executions") public void onTimeout(jakarta.ejb.Timer _timer) This is the method which processes the timeout event depending on the running timer settings. The method lookups the event log entries and pushes new snapshots into the archive service.Each eventLogEntry is locked to guaranty exclusive processing. The metric generated : executions count: count of method executions processing Time: application_org_imixs_archive_export_SchedulerService_executions_total event count: error count: application_org_imixs_archive_export_SchedulerService_errors_total
- Throws:
org.imixs.melman.RestAPIException
-
releaseDeadLocks
public void releaseDeadLocks(org.imixs.melman.EventLogClient eventLogClient) throws org.imixs.melman.RestAPIException Asynchronous method to release dead locks- Parameters:
eventLogClient-deadLockInterval-topic-- Throws:
org.imixs.melman.RestAPIException
-
pullFileDataList
public List<org.imixs.workflow.FileData> pullFileDataList(org.imixs.workflow.ItemCollection eventLogEntry, org.imixs.melman.DocumentClient documentClient, org.imixs.melman.EventLogClient eventLogClient) throws ExportException This method loads a snapshot from the workflow instance based on a eventLog entry. In case the workflow instance does not have a $snapshotid, the worklfow instance itself is returned. .The method returns null if the snapshot no longer exists. In this case the method automatically deletes the outdated event log entry.
- Throws:
ExportException
-
restartScheduler
Stops and restarts the timer. The log will be prevented.- Throws:
ExportException
-
startScheduler
This method initializes the scheduler.The method also verifies the existence of the archive keyspace by loading the archive session object.
- Parameters:
clearLog- - if true, the current log will be reset- Throws:
ExportException
-
stopScheduler
This method stops the scheduler.- Throws:
ExportException
-