@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 MCMPHandler
proxies
- a collection of initial ProxyConfiguration
sconnectionListener
- connection listenerorg.jboss.modcluster.mcmp.MCMPHandler#init(java.util.List)
public void shutdown()
shutdown
in interface MCMPHandler
MCMPHandler.shutdown()
public void addProxy(InetSocketAddress socketAddress)
MCMPHandler.status()
.
Same as addProxy(address, port, false
.
addProxy
in interface MCMPHandler
socketAddress
- InetSocketAddress on which the proxy listens for MCMP requestsMCMPHandler.addProxy(java.net.InetSocketAddress)
public void addProxy(ProxyConfiguration proxyConfiguration)
MCMPHandler
MCMPHandler.status()
.
Same as addProxy(proxyConfiguration, false)
.
addProxy
in interface MCMPHandler
proxyConfiguration
- 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 MCMPHandler
socketAddress
- 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)
MCMPHandler
MCMPHandler.status()
.addProxy
in interface MCMPHandler
proxyConfiguration
- 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 MCMPHandler
socketAddress
- InetSocketAddress on which the proxy listens for MCMP requestsMCMPHandler.removeProxy(java.net.InetSocketAddress)
public Set<MCMPServerState> getProxyStates()
getProxyStates
in interface MCMPHandler
MCMPHandler.getProxyStates()
public boolean isProxyHealthOK()
OK
.isProxyHealthOK
in interface MCMPHandler
true
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 MCMPHandler
MCMPHandler.markProxiesInError()
public void reset()
DOWN
up to ERROR
, where the
configuration will be refreshed.reset
in interface MCMPHandler
MCMPHandler.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 MCMPHandler
MCMPHandler.status()
public Map<MCMPServerState,String> sendRequest(MCMPRequest request)
sendRequest
in interface MCMPHandler
request
- the request. Cannot be null
MCMPHandler.sendRequest(org.jboss.modcluster.mcmp.MCMPRequest)
public Map<MCMPServerState,List<String>> sendRequests(List<MCMPRequest> requests)
sendRequests
in interface MCMPHandler
requests
- the requests. Cannot be null
MCMPHandler.sendRequests(java.util.List)
Copyright © 2017 JBoss by Red Hat. All rights reserved.