From 3e4d8ba02ba467ab8892580eb61fcef3dc1edf8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9C=B0=E5=B9=B3=E7=BA=BF?= <22250530@qq.com> Date: Mon, 10 Aug 2015 16:44:33 +0800 Subject: [PATCH] --- src/com/wentch/redkale/boot/Application.java | 3 +++ src/com/wentch/redkale/boot/NodeSncpServer.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/wentch/redkale/boot/Application.java b/src/com/wentch/redkale/boot/Application.java index 27df55814..5de7915b1 100644 --- a/src/com/wentch/redkale/boot/Application.java +++ b/src/com/wentch/redkale/boot/Application.java @@ -54,6 +54,9 @@ public final class Application { //application.xml 文件中resources节点的内容, 类型: AnyValue public static final String RESNAME_GRES = "APP_GRES"; + //当前SNCP Server所属的组 类型: String + public static final String RESNAME_SNCP_GROUP = "SNCP_GROUP"; + //当前SNCP Server的IP地址+端口 类型: SocketAddress、InetSocketAddress public static final String RESNAME_SNCP_ADDRESS = "SNCP_ADDRESS"; diff --git a/src/com/wentch/redkale/boot/NodeSncpServer.java b/src/com/wentch/redkale/boot/NodeSncpServer.java index dfca4a595..3984f2e8e 100644 --- a/src/com/wentch/redkale/boot/NodeSncpServer.java +++ b/src/com/wentch/redkale/boot/NodeSncpServer.java @@ -5,7 +5,7 @@ */ package com.wentch.redkale.boot; -import static com.wentch.redkale.boot.Application.RESNAME_SNCP_ADDRESS; +import static com.wentch.redkale.boot.Application.*; import com.wentch.redkale.net.sncp.*; import com.wentch.redkale.util.AnyValue; import com.wentch.redkale.service.Service; @@ -33,6 +33,7 @@ public final class NodeSncpServer extends NodeServer { this.consumer = server == null ? null : x -> server.addService(x); this.factory.register(RESNAME_SNCP_ADDRESS, SocketAddress.class, this.servaddr); this.factory.register(RESNAME_SNCP_ADDRESS, InetSocketAddress.class, this.servaddr); + this.factory.register(RESNAME_SNCP_GROUP, this.nodeGroup); } @Override