colesico.framework.rpc.clientapi.RpcErrorHandlerFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of colesico-rpc Show documentation
Show all versions of colesico-rpc Show documentation
Colesico framework Remote Procedure Call for Services
The newest version!
package colesico.framework.rpc.clientapi;
import colesico.framework.ioc.Ioc;
import colesico.framework.ioc.key.ClassedKey;
import colesico.framework.rpc.RpcError;
import javax.inject.Singleton;
@Singleton
public class RpcErrorHandlerFactory {
private final Ioc ioc;
public RpcErrorHandlerFactory(Ioc ioc) {
this.ioc = ioc;
}
public RpcErrorHandler getErrorHandler(Class errorClass) {
return ioc.instance(new ClassedKey<>(RpcErrorHandler.class.getCanonicalName(), errorClass.getCanonicalName()), null);
}
}