public class ServerGroup extends Object
registerProxyServer(HttpProxyServer), and when they shut down, must unregister with the
ServerGroup using unregisterProxyServer(HttpProxyServer, boolean).| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_INCOMING_ACCEPTOR_THREADS
The default number of threads to accept incoming requests from clients.
|
static int |
DEFAULT_INCOMING_WORKER_THREADS
The default number of threads to service incoming requests from clients.
|
static int |
DEFAULT_OUTGOING_WORKER_THREADS
The default number of threads to service outgoing requests to servers.
|
List<HttpProxyServer> |
registeredServers
List of all servers registered to use this ServerGroup.
|
| Constructor and Description |
|---|
ServerGroup(String name,
int incomingAcceptorThreads,
int incomingWorkerThreads,
int outgoingWorkerThreads)
Creates a new ServerGroup instance for a proxy.
|
| Modifier and Type | Method and Description |
|---|---|
io.netty.channel.EventLoopGroup |
getClientToProxyAcceptorPoolForTransport(TransportProtocol protocol)
Retrieves the client-to-proxy acceptor thread pool for the specified protocol.
|
io.netty.channel.EventLoopGroup |
getClientToProxyWorkerPoolForTransport(TransportProtocol protocol)
Retrieves the client-to-proxy acceptor worker pool for the specified protocol.
|
io.netty.channel.EventLoopGroup |
getProxyToServerWorkerPoolForTransport(TransportProtocol protocol)
Retrieves the proxy-to-server worker thread pool for the specified protocol.
|
boolean |
isStopped() |
void |
registerProxyServer(HttpProxyServer proxyServer)
Registers the specified proxy server as a consumer of this server group.
|
void |
unregisterProxyServer(HttpProxyServer proxyServer,
boolean graceful)
Unregisters the specified proxy server from this server group.
|
public static final int DEFAULT_INCOMING_ACCEPTOR_THREADS
public static final int DEFAULT_INCOMING_WORKER_THREADS
public static final int DEFAULT_OUTGOING_WORKER_THREADS
public final List<HttpProxyServer> registeredServers
SERVER_REGISTRATION_LOCK.public ServerGroup(String name, int incomingAcceptorThreads, int incomingWorkerThreads, int outgoingWorkerThreads)
name - ServerGroup name to include in thread namesincomingAcceptorThreads - number of acceptor threads per protocolincomingWorkerThreads - number of client-to-proxy worker threads per protocoloutgoingWorkerThreads - number of proxy-to-server worker threads per protocolpublic void registerProxyServer(HttpProxyServer proxyServer)
proxyServer - proxy server instance to registerpublic void unregisterProxyServer(HttpProxyServer proxyServer, boolean graceful)
proxyServer - proxy server instance to unregistergraceful - when true, the server group shutdown (if necessary) will be gracefulpublic io.netty.channel.EventLoopGroup getClientToProxyAcceptorPoolForTransport(TransportProtocol protocol)
This method is thread-safe; no external locking is necessary.
protocol - transport protocol to retrieve the thread pool forpublic io.netty.channel.EventLoopGroup getClientToProxyWorkerPoolForTransport(TransportProtocol protocol)
This method is thread-safe; no external locking is necessary.
protocol - transport protocol to retrieve the thread pool forpublic io.netty.channel.EventLoopGroup getProxyToServerWorkerPoolForTransport(TransportProtocol protocol)
This method is thread-safe; no external locking is necessary.
protocol - transport protocol to retrieve the thread pool forpublic boolean isStopped()
Copyright © 2009–2016 LittleShoot. All rights reserved.