Class SchedulerService

java.lang.Object
org.imixs.archive.export.services.SchedulerService

public class SchedulerService extends Object
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
    Modifier and Type
    Field
    Description
    static String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    onTimeout(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.
    void
    releaseDeadLocks(org.imixs.melman.EventLogClient eventLogClient)
    Asynchronous method to release dead locks
    void
    Stops and restarts the timer.
    void
    startScheduler(boolean clearLog)
    This method initializes the scheduler.
    boolean
    This method stops the scheduler.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SNAPSHOTID

      public static String 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

      public void restartScheduler() throws ExportException
      Stops and restarts the timer. The log will be prevented.
      Throws:
      ExportException
    • startScheduler

      public void startScheduler(boolean clearLog) throws ExportException
      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

      public boolean stopScheduler() throws ExportException
      This method stops the scheduler.
      Throws:
      ExportException