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

io.github.jzdayz.server.RpcManager Maven / Gradle / Ivy

There is a newer version: 6.0.0
Show newest version
package io.github.jzdayz.server;

import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.Method;

@Slf4j
public class RpcManager {
    public static Object invoke(String id,String methodName,Object... args) throws Exception{
        RpcRegister.RBean rBean = RpcRegister.INSTANCE.getProviderContainer().get(id);
        Method method = rBean.getMethods().get(methodName);
        try {
            return method.invoke(rBean.getBean(),args);
        }catch (Exception e){
            log.error("method invoke error",e);
            throw new RuntimeException(e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy