This commit is contained in:
Redkale
2016-10-10 19:19:56 +08:00
parent beffe53d4d
commit b2c6dd2db2
4 changed files with 13 additions and 13 deletions

View File

@@ -20,7 +20,7 @@ import org.redkale.net.*;
import static org.redkale.net.sncp.SncpRequest.*; import static org.redkale.net.sncp.SncpRequest.*;
import org.redkale.service.*; import org.redkale.service.*;
import org.redkale.util.*; import org.redkale.util.*;
import org.redkale.service.DynCall; import org.redkale.service.RpcCall;
/** /**
* *
@@ -41,7 +41,7 @@ public final class SncpClient {
protected final Type[] paramTypes; protected final Type[] paramTypes;
protected final Attribute[] paramAttrs; // 为null表示无DynCall处理index=0固定为null, 其他为参数标记的DynCall回调方法 protected final Attribute[] paramAttrs; // 为null表示无RpcCall处理index=0固定为null, 其他为参数标记的RpcCall回调方法
protected final int addressTargetParamIndex; protected final int addressTargetParamIndex;
@@ -76,12 +76,12 @@ public final class SncpClient {
} }
} }
for (Annotation ann : anns[i]) { for (Annotation ann : anns[i]) {
if (ann.annotationType() == DynCall.class) { if (ann.annotationType() == RpcCall.class) {
try { try {
atts[i + 1] = ((DynCall) ann).value().newInstance(); atts[i + 1] = ((RpcCall) ann).value().newInstance();
hasattr = true; hasattr = true;
} catch (Exception e) { } catch (Exception e) {
logger.log(Level.SEVERE, DynCall.class.getSimpleName() + ".attribute cannot a newInstance for" + method, e); logger.log(Level.SEVERE, RpcCall.class.getSimpleName() + ".attribute cannot a newInstance for" + method, e);
} }
break; break;
} }

View File

@@ -21,7 +21,7 @@ import jdk.internal.org.objectweb.asm.Type;
import org.redkale.convert.bson.*; import org.redkale.convert.bson.*;
import org.redkale.service.*; import org.redkale.service.*;
import org.redkale.util.*; import org.redkale.util.*;
import org.redkale.service.DynCall; import org.redkale.service.RpcCall;
/** /**
* *
@@ -141,7 +141,7 @@ public final class SncpDynServlet extends SncpServlet {
@Resource @Resource
protected BsonConvert convert; protected BsonConvert convert;
protected org.redkale.util.Attribute[] paramAttrs; // 为null表示无DynCall处理index=0固定为null, 其他为参数标记的DynCall回调方法 protected org.redkale.util.Attribute[] paramAttrs; // 为null表示无RpcCall处理index=0固定为null, 其他为参数标记的RpcCall回调方法
protected java.lang.reflect.Type[] paramTypes; //index=0表示返回参数的type void的返回参数类型为null protected java.lang.reflect.Type[] paramTypes; //index=0表示返回参数的type void的返回参数类型为null
@@ -405,12 +405,12 @@ public final class SncpDynServlet extends SncpServlet {
for (int i = 0; i < anns.length; i++) { for (int i = 0; i < anns.length; i++) {
if (anns[i].length > 0) { if (anns[i].length > 0) {
for (Annotation ann : anns[i]) { for (Annotation ann : anns[i]) {
if (ann.annotationType() == DynCall.class) { if (ann.annotationType() == RpcCall.class) {
try { try {
atts[i + 1] = ((DynCall) ann).value().newInstance(); atts[i + 1] = ((RpcCall) ann).value().newInstance();
hasattr = true; hasattr = true;
} catch (Exception e) { } catch (Exception e) {
logger.log(Level.SEVERE, DynCall.class.getSimpleName() + ".attribute cannot a newInstance for" + method, e); logger.log(Level.SEVERE, RpcCall.class.getSimpleName() + ".attribute cannot a newInstance for" + method, e);
} }
break; break;
} }

View File

@@ -29,7 +29,7 @@ public class DataSourceService implements DataSource, Service, AutoCloseable {
private DataSource source; private DataSource source;
@Override @Override
public <T> void insert(@DynCall(DataCallArrayAttribute.class) T... values) { public <T> void insert(@RpcCall(DataCallArrayAttribute.class) T... values) {
source.insert(values); source.insert(values);
} }

View File

@@ -10,7 +10,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
import org.redkale.util.*; import org.redkale.util.*;
/** /**
* 参数回写, 当Service的方法需要更改参数对象内部的数据时需要使用DynCall * 参数回写, 当Service的方法需要更改参数对象内部的数据时需要使用RpcCall
* *
* <p> 详情见: http://redkale.org * <p> 详情见: http://redkale.org
* @author zhangjx * @author zhangjx
@@ -19,7 +19,7 @@ import org.redkale.util.*;
@Documented @Documented
@Target({ElementType.PARAMETER}) @Target({ElementType.PARAMETER})
@Retention(RUNTIME) @Retention(RUNTIME)
public @interface DynCall { public @interface RpcCall {
Class<? extends Attribute> value(); Class<? extends Attribute> value();
} }