Skip to content

Commit

Permalink
Add transient to some overrided field (apache#12570)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ authored Jun 19, 2023
1 parent a941985 commit 8ad792c
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.apache.dubbo.rpc.model.ModuleModel;
import org.apache.dubbo.rpc.support.ProtocolUtils;

import java.beans.Transient;

import static org.apache.dubbo.common.constants.CommonConstants.INVOKER_LISTENER_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.REFERENCE_FILTER_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.REFER_ASYNC_KEY;
Expand Down Expand Up @@ -184,6 +186,7 @@ public void setGeneric(String generic) {
}

@Override
@Transient
protected boolean isNeedCheckMethod() {
return StringUtils.isEmpty(getGeneric());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.dubbo.rpc.model.ModuleModel;
import org.apache.dubbo.rpc.model.ScopeModel;

import java.beans.Transient;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -135,11 +136,13 @@ protected void checkScopeModel(ScopeModel scopeModel) {
}

@Override
@Transient
public ModuleModel getScopeModel() {
return (ModuleModel) super.getScopeModel();
}

@Override
@Transient
protected ScopeModel getDefaultModel() {
return ApplicationModel.defaultModel().getDefaultModule();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public List<String> getPrefixes() {
}

@Override
@Transient
public Map<String, String> getMetaData() {
return getMetaData(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ protected void preProcessRefresh() {
}

@Override
@Transient
public Map<String, String> getMetaData() {
return getMetaData(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@

package com.alibaba.dubbo.rpc;

import org.apache.dubbo.rpc.model.ServiceModel;

import java.beans.Transient;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;

import org.apache.dubbo.rpc.model.ServiceModel;

@Deprecated
public interface Invocation extends org.apache.dubbo.rpc.Invocation {

Expand Down Expand Up @@ -184,6 +185,7 @@ public String getAttachment(String key, String defaultValue) {
}

@Override
@Transient
public Invoker<?> getInvoker() {
return new Invoker.CompatibleInvoker(delegate.getInvoker());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@

package com.alibaba.dubbo.rpc;

import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.URL;

import java.beans.Transient;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.URL;

public class RpcInvocation implements Invocation, Serializable {

private static final long serialVersionUID = -4355285085441097045L;
Expand Down Expand Up @@ -101,6 +102,7 @@ public RpcInvocation(String methodName, Class<?>[] parameterTypes, Object[] argu
this.invoker = invoker;
}

@Transient
public Invoker<?> getInvoker() {
return invoker;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ default boolean isHealthy() {

void setApplicationModel(ApplicationModel applicationModel);

@Transient
ApplicationModel getApplicationModel();

@Transient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@
*/
package org.apache.dubbo.rpc;

import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Stream;

import org.apache.dubbo.common.Experimental;
import org.apache.dubbo.rpc.model.ModuleModel;
import org.apache.dubbo.rpc.model.ScopeModelUtil;
import org.apache.dubbo.rpc.model.ServiceModel;

import java.beans.Transient;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Stream;

/**
* Invocation. (API, Prototype, NonThreadSafe)
*
Expand Down Expand Up @@ -148,6 +149,7 @@ default Object getObjectAttachmentWithoutConvert(String key) {
* @return invoker.
* @transient
*/
@Transient
Invoker<?> getInvoker();

void setServiceModel(ServiceModel serviceModel);
Expand Down

0 comments on commit 8ad792c

Please sign in to comment.