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

com.kuaishou.business.extension.spring.ExtExecutor Maven / Gradle / Ivy

The newest version!
package com.kuaishou.business.extension.spring;

import java.util.function.Supplier;

import com.kuaishou.business.core.extpoint.ExtPoint;
import com.kuaishou.business.core.function.ExtAction;
import com.kuaishou.business.core.function.ExtCallback;
import com.kuaishou.business.core.reduce.Reducer;

import lombok.extern.slf4j.Slf4j;

/**
 * @author liuzhuo
 * Created on 2023-03-17 下午5:42
 * 扩展点执行器
 */
@Slf4j
public class ExtExecutor {

    public static  void executeVoid(Class extClz, ExtAction extMethod, Runnable defaultMethod, Reducer reducer) {
        executeVoid(extClz, extMethod, defaultMethod, reducer, null);
    }

    public static  void executeVoid(Class extClz, ExtAction extMethod, Runnable defaultMethod, Reducer reducer, P request) {
        ExtUtils.extActuator.executeVoid(extClz, extMethod, defaultMethod, reducer, request);
    }


    public static  R execute(Class extClz, ExtCallback extMethod, Supplier defaultMethod, Reducer reducer) {
        return execute(extClz, extMethod, defaultMethod, reducer, null);
    }

    public static  R execute(Class extClz, ExtCallback extMethod, Supplier defaultMethod, Reducer reducer, P request) {
        return ExtUtils.extActuator.execute(extClz, extMethod, defaultMethod, reducer, request);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy