|
|
@ -17,8 +17,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
package com.tencent.cloud.plugin.lossless;
|
|
|
|
package com.tencent.cloud.plugin.lossless;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.tencent.cloud.plugin.lossless.config.LosslessProperties;
|
|
|
|
import com.tencent.cloud.plugin.lossless.config.LosslessProperties;
|
|
|
|
import com.tencent.cloud.polaris.context.PolarisSDKContextManager;
|
|
|
|
import com.tencent.cloud.polaris.context.PolarisSDKContextManager;
|
|
|
|
import com.tencent.polaris.api.pojo.BaseInstance;
|
|
|
|
import com.tencent.polaris.api.pojo.BaseInstance;
|
|
|
@ -46,9 +44,6 @@ public class LosslessRegistryAspect {
|
|
|
|
|
|
|
|
|
|
|
|
private PolarisSDKContextManager polarisSDKContextManager;
|
|
|
|
private PolarisSDKContextManager polarisSDKContextManager;
|
|
|
|
|
|
|
|
|
|
|
|
private final AtomicBoolean doneDeregister = new AtomicBoolean(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public LosslessRegistryAspect(ServiceRegistry serviceRegistry, Registration registration,
|
|
|
|
public LosslessRegistryAspect(ServiceRegistry serviceRegistry, Registration registration,
|
|
|
|
LosslessProperties losslessProperties, PolarisSDKContextManager polarisSDKContextManager) {
|
|
|
|
LosslessProperties losslessProperties, PolarisSDKContextManager polarisSDKContextManager) {
|
|
|
|
this.serviceRegistry = serviceRegistry;
|
|
|
|
this.serviceRegistry = serviceRegistry;
|
|
|
@ -86,12 +81,7 @@ public class LosslessRegistryAspect {
|
|
|
|
|
|
|
|
|
|
|
|
@Around("deregisterPointcut()")
|
|
|
|
@Around("deregisterPointcut()")
|
|
|
|
public Object invokeDeregister(ProceedingJoinPoint joinPoint) throws Throwable {
|
|
|
|
public Object invokeDeregister(ProceedingJoinPoint joinPoint) throws Throwable {
|
|
|
|
if (doneDeregister.compareAndSet(false, true)) {
|
|
|
|
return joinPoint.proceed();
|
|
|
|
return joinPoint.proceed();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void executeJoinPoint(ProceedingJoinPoint joinPoint) {
|
|
|
|
public void executeJoinPoint(ProceedingJoinPoint joinPoint) {
|
|
|
|