Search in sources :

Example 1 with FixedResult

use of com.huawei.registry.entity.FixedResult in project Sermant by huaweicloud.

the class RegistrationInterceptor method doBefore.

@Override
public ExecuteContext doBefore(ExecuteContext context) {
    if (!(context.getArguments()[0] instanceof Registration)) {
        return context;
    }
    fillClientInfo((Registration) context.getArguments()[0]);
    final RegisterCenterService service = ServiceManager.getService(RegisterCenterService.class);
    final FixedResult fixedResult = new FixedResult();
    service.register(fixedResult);
    if (fixedResult.isSkip()) {
        context.skip(fixedResult.getResult());
    }
    return context;
}
Also used : FixedResult(com.huawei.registry.entity.FixedResult) Registration(org.springframework.cloud.client.serviceregistry.Registration) RegisterCenterService(com.huawei.registry.services.RegisterCenterService)

Aggregations

FixedResult (com.huawei.registry.entity.FixedResult)1 RegisterCenterService (com.huawei.registry.services.RegisterCenterService)1 Registration (org.springframework.cloud.client.serviceregistry.Registration)1