From 8b2fa83f39ea56146ebe1eeca3b7d9a1c73de99b Mon Sep 17 00:00:00 2001 From: wentch <22250530@qq.com> Date: Mon, 21 Dec 2015 17:19:16 +0800 Subject: [PATCH] --- .../org/redkale/net/socks/SocksContext.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src-plugin/org/redkale/net/socks/SocksContext.java diff --git a/src-plugin/org/redkale/net/socks/SocksContext.java b/src-plugin/org/redkale/net/socks/SocksContext.java new file mode 100644 index 000000000..7060dc51c --- /dev/null +++ b/src-plugin/org/redkale/net/socks/SocksContext.java @@ -0,0 +1,45 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.net.socks; + +import java.net.*; +import java.nio.*; +import java.nio.channels.*; +import java.nio.charset.*; +import java.util.concurrent.*; +import java.util.logging.*; +import org.redkale.net.*; +import org.redkale.net.http.*; +import org.redkale.util.*; +import org.redkale.watch.*; + +/** + * + * @author zhangjx + */ +public class SocksContext extends HttpContext { + + protected final AsynchronousChannelGroup group; + + public SocksContext(long serverStartTime, Logger logger, ExecutorService executor, int bufferCapacity, ObjectPool bufferPool, + ObjectPool responsePool, int maxbody, Charset charset, InetSocketAddress address, PrepareServlet prepare, + WatchFactory watch, int readTimeoutSecond, int writeTimeoutSecond, String contextPath) { + super(serverStartTime, logger, executor, bufferCapacity, bufferPool, responsePool, maxbody, charset, + address, prepare, watch, readTimeoutSecond, writeTimeoutSecond, contextPath); + AsynchronousChannelGroup g = null; + try { + g = AsynchronousChannelGroup.withThreadPool(executor); + } catch (Exception e) { + e.printStackTrace(); + } + this.group = g; + } + + protected AsynchronousChannelGroup getAsynchronousChannelGroup() { + return group; + } + +}