All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cloudfoundry.multiapps.controller.process.util.HooksPhaseGetter Maven / Gradle / Ivy

There is a newer version: 1.183.0
Show newest version
package org.cloudfoundry.multiapps.controller.process.util;

import java.util.Collections;
import java.util.List;

import jakarta.inject.Named;

import org.cloudfoundry.multiapps.controller.core.model.HookPhase;
import org.cloudfoundry.multiapps.controller.process.steps.AfterStepHookPhaseProvider;
import org.cloudfoundry.multiapps.controller.process.steps.BeforeStepHookPhaseProvider;
import org.cloudfoundry.multiapps.controller.process.steps.ProcessContext;
import org.cloudfoundry.multiapps.controller.process.steps.SyncFlowableStep;

@Named
public class HooksPhaseGetter {

    public List getHookPhasesBeforeStop(SyncFlowableStep syncFlowableStep, ProcessContext context) {
        if (syncFlowableStep instanceof BeforeStepHookPhaseProvider) {
            return ((BeforeStepHookPhaseProvider) syncFlowableStep).getHookPhasesBeforeStep(context);
        }
        return Collections.singletonList(HookPhase.NONE);
    }

    public List getHookPhasesAfterStop(SyncFlowableStep syncFlowableStep, ProcessContext context) {
        if (syncFlowableStep instanceof AfterStepHookPhaseProvider) {
            return ((AfterStepHookPhaseProvider) syncFlowableStep).getHookPhasesAfterStep(context);
        }
        return Collections.singletonList(HookPhase.NONE);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy