This commit is contained in:
wentch
2015-12-16 11:28:43 +08:00
parent ad12a05b93
commit 4677fc6fa3
2 changed files with 6 additions and 2 deletions

View File

@@ -118,8 +118,8 @@ public final class SncpClient {
protected final Consumer<Runnable> executor;
public SncpClient(final String serviceName, final Consumer<Runnable> executor, final long serviceid, boolean remote, final Class serviceClass,
boolean onlySncpDyn, final InetSocketAddress clientAddress, final HashSet<String> groups) {
if (serviceName.length() > 10) throw new RuntimeException(serviceClass + " @Resource name(" + serviceName + ") too long , must less 11");
boolean onlySncpDyn, final InetSocketAddress clientAddress, final HashSet<String> groups) { // 以下划线_开头的serviceName只能是被系统分配, 且长度可以超过11位
if (serviceName.length() > 10 && serviceName.charAt(0) != '_') throw new RuntimeException(serviceClass + " @Resource name(" + serviceName + ") too long , must less 11");
this.remote = remote;
this.executor = executor;
this.serviceClass = serviceClass;

View File

@@ -9,6 +9,10 @@ import org.redkale.util.*;
/**
* 所有Service的实现类不得声明为final 允许远程模式的public方法和public String name()方法都不能声明为final。
* 注意:
* 1、"$"是一个很特殊的Service.name值 。 被标记为@Resource(name = "$") 的Service的资源名与所属父Service的资源名一致。
* 2、以下划线_开头的Service.name只能是被系统分配, 且长度可以超过11位。使用者定义name不得以_开头。
*
* <p>
* @Resource(name = ".*")
* private HashMap<String, XXXService> nodemap;