public class Server extends Object implements ServerMXBean
| Modifier and Type | Field and Description |
|---|---|
protected one.nio.server.AcceptorThread[] |
acceptors |
protected CleanupThread |
cleanup |
protected int |
port |
protected SelectorThread[] |
selectors |
protected CountDownLatch |
startSync |
protected boolean |
useWorkers |
protected one.nio.server.WorkerPool |
workers |
| Constructor and Description |
|---|
Server(ServerConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncExecute(Runnable command) |
protected Session |
createSession(Socket socket) |
long |
getAcceptedSessions() |
int |
getConnections() |
long |
getKeepAlive() |
long |
getQueueAvgBytes() |
double |
getQueueAvgLength() |
long |
getQueueMaxBytes() |
long |
getQueueMaxLength() |
long |
getRejectedSessions() |
long |
getRequestsProcessed() |
long |
getRequestsRejected() |
double |
getSelectorAvgReady() |
int |
getSelectorCount() |
int |
getSelectorMaxReady() |
long |
getSelectorOperations() |
long |
getSelectorSessions() |
int |
getWorkers() |
int |
getWorkersActive() |
boolean |
getWorkersUsed() |
long |
incRequestsProcessed() |
long |
incRequestsRejected() |
void |
reconfigure(ServerConfig config) |
protected void |
register(Session session) |
void |
registerShutdownHook() |
void |
reset() |
void |
start() |
void |
stop() |
protected final int port
protected final one.nio.server.AcceptorThread[] acceptors
protected final CountDownLatch startSync
protected volatile SelectorThread[] selectors
protected final one.nio.server.WorkerPool workers
protected boolean useWorkers
protected final CleanupThread cleanup
public Server(ServerConfig config) throws IOException
IOExceptionpublic void reconfigure(ServerConfig config) throws IOException
IOExceptionpublic void start()
public void stop()
public void registerShutdownHook()
protected Session createSession(Socket socket) throws RejectedSessionException
RejectedSessionExceptionprotected void register(Session session)
public final long incRequestsProcessed()
public final long incRequestsRejected()
public int getConnections()
getConnections in interface ServerMXBeanpublic long getKeepAlive()
getKeepAlive in interface ServerMXBeanpublic boolean getWorkersUsed()
getWorkersUsed in interface ServerMXBeanpublic int getWorkers()
getWorkers in interface ServerMXBeanpublic int getWorkersActive()
getWorkersActive in interface ServerMXBeanpublic long getAcceptedSessions()
getAcceptedSessions in interface ServerMXBeanpublic long getRejectedSessions()
getRejectedSessions in interface ServerMXBeanpublic int getSelectorCount()
getSelectorCount in interface ServerMXBeanpublic double getSelectorAvgReady()
getSelectorAvgReady in interface ServerMXBeanpublic int getSelectorMaxReady()
getSelectorMaxReady in interface ServerMXBeanpublic long getSelectorOperations()
getSelectorOperations in interface ServerMXBeanpublic long getSelectorSessions()
getSelectorSessions in interface ServerMXBeanpublic double getQueueAvgLength()
getQueueAvgLength in interface ServerMXBeanpublic long getQueueAvgBytes()
getQueueAvgBytes in interface ServerMXBeanpublic long getQueueMaxLength()
getQueueMaxLength in interface ServerMXBeanpublic long getQueueMaxBytes()
getQueueMaxBytes in interface ServerMXBeanpublic long getRequestsProcessed()
getRequestsProcessed in interface ServerMXBeanpublic long getRequestsRejected()
getRequestsRejected in interface ServerMXBeanpublic void reset()
reset in interface ServerMXBeanpublic final void asyncExecute(Runnable command)
Copyright © 2019. All rights reserved.