Annotating Classes and Methods
You can apply the @SystemSetup annotation on a class level and a method level. @SystemSetup provides a few flags that are exclusively designed to be used with the Patching Framework.
A class level annotation is required for the special SystemSetupCollector class to find all Spring Beans annotated as @SystemSetup. A method level annotation is required to determine which methods must be executed during the initialization or the update phase. When you look at @SystemSetup as a patch, each method of an annotated class becomes a separate patch.
The @SystemSetup annotation flags designed for the Patching Framework include:
-
patch: marks a logic as one to be executed only once
-
required: determines whether a logic is to be executed or not
-
name: allows you to provide a name of a logic to be executed
-
description: allows you to provide a longer logic description
A properly annotated logic is executed once. You can choose whether you want to execute it during system update or initialization - it depends on the option you provide for the @SystemSetup process flag (UPDATE, INIT, or ALL). For more information on @SystemSetup, see Hooks for Initialization and Update Process.