@ThreadSafe public class DefaultMCMPHandler extends Object implements MCMPHandler
MCMPHandler.| Constructor and Description |
|---|
DefaultMCMPHandler(MCMPHandlerConfiguration config,
ResetRequestSource source,
MCMPRequestFactory requestFactory,
MCMPResponseParser responseParser) |
| Modifier and Type | Method and Description |
|---|---|
void |
addProxy(InetSocketAddress socketAddress)
Add a proxy to the list of those with which this handler communicates.
|
void |
addProxy(InetSocketAddress socketAddress,
boolean established)
Add a proxy to the list of those with which this handler communicates.
|
void |
addProxy(ProxyConfiguration proxyConfiguration)
Add a proxy to the list of those with which this handler communicates.
|
void |
addProxy(ProxyConfiguration proxyConfiguration,
boolean established)
Add a proxy to the list of those with which this handler communicates.
|
Set<MCMPServerState> |
getProxyStates()
Get the state of all proxies
|
void |
init(Collection<ProxyConfiguration> proxies,
MCMPConnectionListener connectionListener)
Initialization method for MCMP handler.
|
boolean |
isProxyHealthOK()
Convenience method that checks whether the status of all proxies is
OK. |
void |
markProxiesInError()
Reset any proxies whose status is
OK down to ERROR, which will
trigger a refresh of their configuration. |
void |
removeProxy(InetSocketAddress socketAddress)
Remove a proxy from the list of those with which this handler communicates.
|
void |
reset()
Reset any proxies whose status is
DOWN up to ERROR, where the
configuration will be refreshed. |
Map<MCMPServerState,String> |
sendRequest(MCMPRequest request)
Send a request to all healthy proxies.
|
Map<MCMPServerState,List<String>> |
sendRequests(List<MCMPRequest> requests)
Send a list of requests to all healthy proxies, with all requests in the list sent to each proxy before moving on to the
next.
|
void |
shutdown()
Perform any shut down work.
|
void |
status()
Perform periodic processing.
|
public DefaultMCMPHandler(MCMPHandlerConfiguration config, ResetRequestSource source, MCMPRequestFactory requestFactory, MCMPResponseParser responseParser)
public void init(Collection<ProxyConfiguration> proxies, MCMPConnectionListener connectionListener)
init in interface MCMPHandlerproxies - a collection of initial ProxyConfigurationsconnectionListener - connection listenerorg.jboss.modcluster.mcmp.MCMPHandler#init(java.util.List)public void shutdown()
shutdown in interface MCMPHandlerMCMPHandler.shutdown()public void addProxy(InetSocketAddress socketAddress)
MCMPHandler.status().
Same as addProxy(address, port, false.
addProxy in interface MCMPHandlersocketAddress - InetSocketAddress on which the proxy listens for MCMP requestsMCMPHandler.addProxy(java.net.InetSocketAddress)public void addProxy(ProxyConfiguration proxyConfiguration)
MCMPHandlerMCMPHandler.status().
Same as addProxy(proxyConfiguration, false).
addProxy in interface MCMPHandlerproxyConfiguration - ProxyConfiguration defining address on which the proxy listens for MCMP requests
and optional local address to bind connections topublic void addProxy(InetSocketAddress socketAddress, boolean established)
MCMPHandler.status().addProxy in interface MCMPHandlersocketAddress - InetSocketAddress on which the proxy listens for MCMP requestsestablished - true if the proxy should be considered established,
false otherwise.MCMPHandler.addProxy(java.net.InetSocketAddress, boolean)public void addProxy(ProxyConfiguration proxyConfiguration, boolean established)
MCMPHandlerMCMPHandler.status().addProxy in interface MCMPHandlerproxyConfiguration - ProxyConfiguration defining address on which the proxy listens for MCMP requests
and optional local address to bind connections toestablished - true if the proxy should be considered established,
false otherwise.public void removeProxy(InetSocketAddress socketAddress)
MCMPHandler.status().removeProxy in interface MCMPHandlersocketAddress - InetSocketAddress on which the proxy listens for MCMP requestsMCMPHandler.removeProxy(java.net.InetSocketAddress)public Set<MCMPServerState> getProxyStates()
getProxyStates in interface MCMPHandlerMCMPHandler.getProxyStates()public boolean isProxyHealthOK()
OK.isProxyHealthOK in interface MCMPHandlertrue if all proxies are OK, false otherwiseMCMPHandler.isProxyHealthOK()public void markProxiesInError()
OK down to ERROR, which will
trigger a refresh of their configuration.markProxiesInError in interface MCMPHandlerMCMPHandler.markProxiesInError()public void reset()
DOWN up to ERROR, where the
configuration will be refreshed.reset in interface MCMPHandlerMCMPHandler.reset()public void status()
addProxy(...) or
removeProxy(...). Attempt to establish communication with any proxies whose state is
ERROR. If successful and a ResetRequestSource has been provided, update the proxy
with the list of requests provided by the source.status in interface MCMPHandlerMCMPHandler.status()public Map<MCMPServerState,String> sendRequest(MCMPRequest request)
sendRequest in interface MCMPHandlerrequest - the request. Cannot be nullMCMPHandler.sendRequest(org.jboss.modcluster.mcmp.MCMPRequest)public Map<MCMPServerState,List<String>> sendRequests(List<MCMPRequest> requests)
sendRequests in interface MCMPHandlerrequests - the requests. Cannot be nullMCMPHandler.sendRequests(java.util.List)Copyright © 2024 JBoss by Red Hat. All rights reserved.