This commit is contained in:
Redkale
2016-09-23 10:03:49 +08:00
parent 4fb218fd18
commit 6f056bbcb6
4 changed files with 19 additions and 6 deletions

View File

@@ -68,7 +68,7 @@ public final class Rest {
int mod = baseServletClass.getModifiers();
if (!java.lang.reflect.Modifier.isPublic(mod)) return null;
if (java.lang.reflect.Modifier.isAbstract(mod)) return null;
final String serviceDesc = Type.getDescriptor(serviceType);
final String webServletDesc = Type.getDescriptor(WebServlet.class);
final String reqDesc = Type.getDescriptor(HttpRequest.class);
@@ -180,6 +180,7 @@ public final class Rest {
if (EXCLUDERMETHODS.contains(method.getName())) continue;
if ("init".equals(method.getName())) continue;
if ("destroy".equals(method.getName())) continue;
if ("version".equals(method.getName())) continue;
RestMapping[] mappings = method.getAnnotationsByType(RestMapping.class);
boolean ignore = false;

View File

@@ -177,6 +177,7 @@ public final class SncpClient {
if (method.getName().equals("equals") || method.getName().equals("hashCode")) continue;
if (method.getName().equals("notify") || method.getName().equals("notifyAll") || method.getName().equals("wait")) continue;
if (method.getName().equals("init") || method.getName().equals("destroy")) continue;
if (method.getName().equals("version") || method.getName().equals("name")) continue;
//if (onlySncpDyn && method.getAnnotation(SncpDyn.class) == null) continue;
DLong actionid = Sncp.hash(method);
Method old = actionids.get(actionid);

View File

@@ -62,7 +62,8 @@ public final class SncpDynServlet extends SncpServlet {
if (method.getName().equals("getClass") || method.getName().equals("toString")) continue;
if (method.getName().equals("equals") || method.getName().equals("hashCode")) continue;
if (method.getName().equals("notify") || method.getName().equals("notifyAll") || method.getName().equals("wait")) continue;
if (method.getName().equals("init") || method.getName().equals("destroy") || method.getName().equals("name")) continue;
if (method.getName().equals("init") || method.getName().equals("destroy")) continue;
if (method.getName().equals("version") || method.getName().equals("name")) continue;
final DLong actionid = Sncp.hash(method);
SncpServletAction action = SncpServletAction.create(service, actionid, method);
action.convert = convert;
@@ -182,9 +183,9 @@ public final class SncpDynServlet extends SncpServlet {
* }
* </pre></blockquote>
*
* @param service Service
* @param service Service
* @param actionid 操作ID
* @param method 方法
* @param method 方法
*
* @return SncpServletAction
*/

View File

@@ -10,7 +10,7 @@ import org.redkale.util.*;
/**
* 所有Service的实现类不得声明为final 允许远程模式的public方法都不能声明为final。
* 注意: "$"是一个很特殊的Service.name值 。 被标记为@Resource(name = "$") 的Service的资源名与所属父Service的资源名一致。
*
*
* <blockquote><pre>
* Service的资源类型
* 业务逻辑的Service通常有两种编写方式
@@ -18,7 +18,7 @@ import org.redkale.util.*;
* 2、先定义业务的Service接口或抽象类再编写具体实现类。
* 第二种方式需要在具体实现类上使用&#64;ResourceType指明资源注入的类型。
* </pre></blockquote>
*
*
* <p>
* 详情见: http://redkale.org
*
@@ -44,4 +44,14 @@ public interface Service {
}
/**
* Service的接口版本号
* <b>注: public方法的参数或返回类型或参数类型内部变更后改值必须进行改变</b>
*
* @return 接口版本号
*/
default int version() {
return 0;
}
}