模块 org.redkale
程序包 org.redkale.net
类 Server<K extends Serializable,C extends Context,R extends Request<C>,P extends Response<C,R>,S extends Servlet<C,R,P>>
- java.lang.Object
-
- org.redkale.net.Server<K,C,R,P,S>
-
- 类型参数:
K
- 请求ID的数据类型, 例如HTTP协议请求标识为url,请求ID的数据类型就是StringC
- ContextR
- RequestP
- ResponseS
- Servlet
- 直接已知子类:
HttpServer
,SncpServer
public abstract class Server<K extends Serializable,C extends Context,R extends Request<C>,P extends Response<C,R>,S extends Servlet<C,R,P>> extends Object
详情见: https://redkale.org- 作者:
- zhangjx
-
-
字段概要
字段 修饰符和类型 字段 说明 protected InetSocketAddress
address
protected int
aliveTimeoutSeconds
protected Application
application
protected int
backlog
protected int
bufferCapacity
protected int
bufferPoolSize
protected Charset
charset
protected AnyValue
config
protected C
context
protected DispatcherServlet<K,C,R,P,S>
dispatcher
protected Logger
logger
protected int
maxBody
protected int
maxConns
protected int
maxHeader
protected String
name
protected String
netprotocol
protected int
readTimeoutSeconds
static String
RESNAME_SERVER_ROOT
protected ResourceFactory
resourceFactory
protected int
responsePoolSize
protected ProtocolServer
serverChannel
protected RedkaleClassLoader
serverClassLoader
protected long
serverStartTime
protected SSLBuilder
sslBuilder
protected SSLContext
sslContext
protected int
writeTimeoutSeconds
-
构造器概要
构造器 限定符 构造器 说明 protected
Server(Application application, long serverStartTime, String netprotocol, ResourceFactory resourceFactory, DispatcherServlet<K,C,R,P,S> servlet)
-
方法概要
-
-
-
字段详细资料
-
logger
protected final Logger logger
-
application
protected Application application
-
serverStartTime
protected final long serverStartTime
-
name
protected String name
-
netprotocol
protected final String netprotocol
-
resourceFactory
protected final ResourceFactory resourceFactory
-
dispatcher
protected final DispatcherServlet<K extends Serializable,C extends Context,R extends Request<C>,P extends Response<C,R>,S extends Servlet<C,R,P>> dispatcher
-
serverClassLoader
protected RedkaleClassLoader serverClassLoader
-
sslBuilder
protected SSLBuilder sslBuilder
-
sslContext
protected SSLContext sslContext
-
config
protected AnyValue config
-
charset
protected Charset charset
-
address
protected InetSocketAddress address
-
backlog
protected int backlog
-
serverChannel
protected ProtocolServer serverChannel
-
bufferCapacity
protected int bufferCapacity
-
bufferPoolSize
protected int bufferPoolSize
-
responsePoolSize
protected int responsePoolSize
-
maxConns
protected int maxConns
-
maxHeader
protected int maxHeader
-
maxBody
protected int maxBody
-
aliveTimeoutSeconds
protected int aliveTimeoutSeconds
-
readTimeoutSeconds
protected int readTimeoutSeconds
-
writeTimeoutSeconds
protected int writeTimeoutSeconds
-
-
构造器详细资料
-
Server
protected Server(Application application, long serverStartTime, String netprotocol, ResourceFactory resourceFactory, DispatcherServlet<K,C,R,P,S> servlet)
-
-
方法详细资料
-
getConfBufferPoolSize
public static int getConfBufferPoolSize(AnyValue config)
-
parseLenth
protected static int parseLenth(String value, int defValue)
-
parseLenth
protected static long parseLenth(String value, long defValue)
-
formatLenth
protected static String formatLenth(long value)
-
getResourceFactory
public ResourceFactory getResourceFactory()
-
getSocketAddress
public InetSocketAddress getSocketAddress()
-
getName
public String getName()
-
getNetprotocol
public String getNetprotocol()
-
getLogger
public Logger getLogger()
-
getContext
public C getContext()
-
getServerStartTime
public long getServerStartTime()
-
getCharset
public Charset getCharset()
-
getBacklog
public int getBacklog()
-
getBufferCapacity
public int getBufferCapacity()
-
getBufferPoolSize
public int getBufferPoolSize()
-
getResponsePoolSize
public int getResponsePoolSize()
-
getAliveTimeoutSeconds
public int getAliveTimeoutSeconds()
-
getReadTimeoutSeconds
public int getReadTimeoutSeconds()
-
getWriteTimeoutSeconds
public int getWriteTimeoutSeconds()
-
getMaxConns
public int getMaxConns()
-
getMaxHeader
public int getMaxHeader()
-
getMaxBody
public int getMaxBody()
-
start
public void start() throws IOException
- 抛出:
IOException
-
startExtLog
protected String startExtLog()
-
postPrepareInit
protected void postPrepareInit()
-
postStart
protected void postStart()
-
changeAddress
public void changeAddress(Application application, InetSocketAddress addr) throws IOException
- 抛出:
IOException
-
changeCharset
public void changeCharset(Charset newCharset)
-
changeMaxconns
public void changeMaxconns(int newMaxConns)
-
changeMaxHeader
public void changeMaxHeader(int newMaxHeader)
-
changeMaxBody
public void changeMaxBody(int newMaxBody)
-
changeReadTimeoutSeconds
public void changeReadTimeoutSeconds(int newReadTimeoutSeconds)
-
changeWriteTimeoutSeconds
public void changeWriteTimeoutSeconds(int newWriteTimeoutSeconds)
-
changeAliveTimeoutSeconds
public void changeAliveTimeoutSeconds(int newAliveTimeoutSeconds)
-
createContext
protected abstract C createContext()
-
initContextConfig
protected void initContextConfig(Context.ContextConfig contextConfig)
-
createSafeBufferPool
protected abstract ByteBufferPool createSafeBufferPool(LongAdder createCounter, LongAdder cycleCounter, int bufferPoolSize)
-
createSafeResponsePool
protected abstract ObjectPool<P> createSafeResponsePool(LongAdder createCounter, LongAdder cycleCounter, int responsePoolSize)
-
shutdown
public void shutdown() throws IOException
- 抛出:
IOException
-
getServerClassLoader
public RedkaleClassLoader getServerClassLoader()
-
setServerClassLoader
public void setServerClassLoader(RedkaleClassLoader serverClassLoader)
-
getAsyncGroup
public AsyncGroup getAsyncGroup()
-
containsFilter
public <T extends Filter> boolean containsFilter(Class<T> filterClass)
判断是否存在Filter- 类型参数:
T
- 泛型- 参数:
filterClass
- Filter类- 返回:
- boolean
-
containsFilter
public boolean containsFilter(String filterClassName)
判断是否存在Filter- 参数:
filterClassName
- Filter类- 返回:
- boolean
-
destroyFilter
public <T extends Filter> void destroyFilter(T filter)
销毁Servlet- 类型参数:
T
- 泛型- 参数:
filter
- Filter
-
containsServlet
public boolean containsServlet(Class<? extends S> servletClass)
判断是否存在Servlet- 参数:
servletClass
- Servlet类- 返回:
- boolean
-
containsServlet
public boolean containsServlet(String servletClassName)
判断是否存在Servlet- 参数:
servletClassName
- Servlet类- 返回:
- boolean
-
destroyServlet
public void destroyServlet(S servlet)
销毁Servlet- 参数:
servlet
- Servlet
-
getCreateConnectionCount
public long getCreateConnectionCount()
-
getClosedConnectionCount
public long getClosedConnectionCount()
-
getLivingConnectionCount
public long getLivingConnectionCount()
-
loadLib
public static URI[] loadLib(RedkaleClassLoader classLoader, Logger logger, String lib)
-
-