use of com.huaweicloud.servicecomb.discovery.registry.ServiceCombRegistration in project Sermant by huaweicloud.
the class RegisterServiceImpl method after.
@Override
public void after(Object obj, Method method, Object[] arguments, Object result) {
if (result instanceof Microservice) {
Microservice microservice = (Microservice) result;
CurrentInstance.newInstance(microservice.getServiceName(), microservice.getInstance().getHostName(), RouterUtil.INVALID_PORT);
} else if (arguments[0] instanceof ServiceCombRegistration) {
ServiceCombRegistration serviceCombRegistration = (ServiceCombRegistration) arguments[0];
CurrentInstance.newInstance(serviceCombRegistration.getServiceId(), serviceCombRegistration.getHost(), serviceCombRegistration.getPort());
}
}
Aggregations