Hybris中如何触发注解@SystemSetup?

How to trigger annotation @SystemSetup in Hybris?

下面有一个用@SystemSetup注解的方法,但是如何触发这个方法呢?

@SystemSetup(extension = IwacockpitsConstants.EXTENSIONNAME)
public class IwaCockpitsSystemSetup{
    @SystemSetup(type = SystemSetup.Type.ALL, process = SystemSetup.Process.ALL)
    public void createCsCockpitUsers(){}
}

另外,还有官方评论:

/**
 * This class is called during IwaCockpits system setup, either selecting essential or project data.
 * 
 * The main method of this class ({@link #createCsCockpitUsers()} is responsible for creating all the IWA CSCockpit
 * custom groups and their restrictions.
 */

实际上,Hybris 会在 updateinit 过程中(因为 process = Process.ALL)以及创建 essentialproject 数据(因为 type = Type.ALL)这可以从 HAC 或使用 Ant 完成:

例如尝试 Update 进程并创建 EssentialHAC 检查的数据以调用方法:

以下是根据 @SystemSetup 输入执行方法的不同情况。

@SystemSetup(extension = IwacockpitsConstants.EXTENSIONNAME)
public class IwaCockpitsSystemSetup{

    @SystemSetup(process = SystemSetup.Process.INIT, type = SystemSetup.Type.ESSENTIAL)
    public void method_1(){

        //will be executed during the initialization process when the essential data for extension iwacockpits is created.

    }

    @SystemSetup(process = SystemSetup.Process.INIT, type = SystemSetup.Type.PROJECT)
    public void method_2(){

        //will be executed during the initialization process while creation of project data for extension iwacockpits.

    }

    @SystemSetup(process = SystemSetup.Process.UPDATE, type = SystemSetup.Type.ESSENTIAL)
    public void method_3(){

        //will be executed during the update process when the essential data for extension iwacockpits is created.

    }

    @SystemSetup(process = SystemSetup.Process.UPDATE, type = SystemSetup.Type.PROJECT)
    public void method_4){

        //will be executed during the initialization process when the project data for extension iwacockpits is created.

    }

    @SystemSetup(process = SystemSetup.Process.ALL, type = SystemSetup.Type.ALL)
    public void method_5){

        //will be executed during creation of project data or essential data in the same extension, in both init and update.

    }

}