Skip to content

Commit

Permalink
RpcServiceInvocationHandler#invoke方法判断调整
Browse files Browse the repository at this point in the history
  • Loading branch information
yukun committed May 31, 2021
1 parent f571f06 commit 506d51f
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ public RpcServiceInvocationHandler(RpcServiceAnnotationMetaData metaData){
}

public RpcServiceInvocationHandler(ApplicationContext context){
ServiceDiscovery discovery = context.getBean(ServiceDiscovery.class);
if (discovery==null){
throw new RuntimeException("serviceRegistry bean not found !");
}
this.serviceDiscovery = discovery;
this.serviceDiscovery = context.getBean(ServiceDiscovery.class);
}

/**
Expand All @@ -55,7 +51,7 @@ public RpcServiceInvocationHandler(ApplicationContext context){
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
/*如果是当前类的实例自己调用自己的invoke方法的话,那就直接返回*/
if (method.getDeclaringClass().equals(this)){
if (method.getDeclaringClass().equals(this.getClass())){
return method.invoke(proxy,args);
}

Expand Down

0 comments on commit 506d51f

Please sign in to comment.