This commit is contained in:
RedKale
2016-06-21 13:05:31 +08:00
parent c08928710c
commit 27b8daa587

View File

@@ -31,9 +31,7 @@ import org.w3c.dom.*;
/** /**
* 编译时需要加入: -XDignore.symbol.file=true * 编译时需要加入: -XDignore.symbol.file=true
* <p> * <p>
* 进程启动类程序启动后读取application.xml,进行classpath扫描动态加载Service与Servlet * 进程启动类程序启动后读取application.xml,进行classpath扫描动态加载Service与Servlet 优先加载所有SNCP协议的服务 再加载其他协议服务, 最后进行Service、Servlet与其他资源之间的依赖注入。
* 优先加载所有SNCP协议的服务 再加载其他协议服务,
* 最后进行Service、Servlet与其他资源之间的依赖注入。
* *
* *
* <p> * <p>
@@ -211,11 +209,11 @@ public final class Application {
final int bufferPoolSize = transportConf.getIntValue("bufferPoolSize", groupsize * Runtime.getRuntime().availableProcessors() * 8); final int bufferPoolSize = transportConf.getIntValue("bufferPoolSize", groupsize * Runtime.getRuntime().availableProcessors() * 8);
final int threads = transportConf.getIntValue("threads", groupsize * Runtime.getRuntime().availableProcessors() * 8); final int threads = transportConf.getIntValue("threads", groupsize * Runtime.getRuntime().availableProcessors() * 8);
transportPool = new ObjectPool<>(createBufferCounter, cycleBufferCounter, bufferPoolSize, transportPool = new ObjectPool<>(createBufferCounter, cycleBufferCounter, bufferPoolSize,
(Object... params) -> ByteBuffer.allocateDirect(bufferCapacity), null, (e) -> { (Object... params) -> ByteBuffer.allocateDirect(bufferCapacity), null, (e) -> {
if (e == null || e.isReadOnly() || e.capacity() != bufferCapacity) return false; if (e == null || e.isReadOnly() || e.capacity() != bufferCapacity) return false;
e.clear(); e.clear();
return true; return true;
}); });
//-----------transportChannelGroup-------------- //-----------transportChannelGroup--------------
try { try {
final AtomicInteger counter = new AtomicInteger(); final AtomicInteger counter = new AtomicInteger();
@@ -472,8 +470,7 @@ public final class Application {
} else { } else {
if (!inited.get()) { if (!inited.get()) {
synchronized (nodeClasses) { synchronized (nodeClasses) {
if (!inited.get()) { if (!inited.getAndSet(true)) { //加载自定义的协议SOCKS
inited.set(true);
ClassFilter profilter = new ClassFilter(NodeProtocol.class, NodeServer.class); ClassFilter profilter = new ClassFilter(NodeProtocol.class, NodeServer.class);
ClassFilter.Loader.load(home, profilter); ClassFilter.Loader.load(home, profilter);
final Set<FilterEntry<NodeServer>> entrys = profilter.getFilterEntrys(); final Set<FilterEntry<NodeServer>> entrys = profilter.getFilterEntrys();