You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

CPS-875 - Getting issue details... STATUS

Spring '@Schedule' annotation

Using Spring '@Schedule' annotation, it is possible to schdule tasks which allows us to create a watchdog.

To enable spring boot to recognise and support scheduled tasks, it is necessary to add '@EnableScheduling' as shown below

Then, all methods that is annotated with '@Schedule' is reccognised as a scheduled taskes depending on the configuration placed.

For the example below, the method 'sayHello()' is configured to run at a fixed rate of 1000ms. Fixed rate will invoke the task at every n millisecond and is useful for independent tasks.

Scheduled tasks can be configured the following ways :


DescriptionNotes
Fixed rate

Fixed delay

Initial delay



Cron


Parameterizing the configuration


Querying state and timestamp 

In NCMP, dataspace and acnhor is hardcoded 

namevalue
NCMP_DATASPACE_NAMENCMP-Admin
NCMP_DMI_REGISTRY_ANCHORncmp-dmi-registry
NCMP_DMI_REGISTRY_PARENT/dmi-registry


NCMP flow



Diagram 7


CPS path

The following tree diagram reflects the new dmi-registry yan model which will have the leaves 'state' and 'lock-reason'

  • No labels