Package org.jboss.modcluster.mcmp.impl
Class DefaultMCMPHandler
java.lang.Object
org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler
- All Implemented Interfaces:
MCMPHandler
Default implementation of
MCMPHandler.- Author:
- Jean-Frederic Clere, Brian Stansberry, Paul Ferraro
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDefaultMCMPHandler(MCMPHandlerConfiguration config, ResetRequestSource source, MCMPRequestFactory requestFactory, MCMPResponseParser responseParser) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProxy(InetSocketAddress socketAddress) Deprecated.voidaddProxy(InetSocketAddress socketAddress, boolean established) Deprecated.voidaddProxy(ProxyConfiguration proxyConfiguration) Add a proxy to the list of those with which this handler communicates.voidaddProxy(ProxyConfiguration proxyConfiguration, boolean established) Add a proxy to the list of those with which this handler communicates.Get the state of all proxiesvoidinit(Collection<ProxyConfiguration> proxies, MCMPConnectionListener connectionListener) Initialization method for MCMP handler.booleanConvenience method that checks whether the status of all proxies isOK.voidvoidremoveProxy(InetSocketAddress socketAddress) Remove a proxy from the list of those with which this handler communicates.voidreset()sendRequest(MCMPRequest request) Send a request to all healthy proxies.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.voidshutdown()Perform any shut down work.voidstatus()Perform periodic processing.
-
Constructor Details
-
DefaultMCMPHandler
public DefaultMCMPHandler(MCMPHandlerConfiguration config, ResetRequestSource source, MCMPRequestFactory requestFactory, MCMPResponseParser responseParser)
-
-
Method Details
-
init
Description copied from interface:MCMPHandlerInitialization method for MCMP handler.- Specified by:
initin interfaceMCMPHandler- Parameters:
proxies- a collection of initialProxyConfigurationsconnectionListener- connection listener
-
shutdown
public void shutdown()Description copied from interface:MCMPHandlerPerform any shut down work.- Specified by:
shutdownin interfaceMCMPHandler
-
addProxy
Deprecated.Description copied from interface:MCMPHandlerAdd a proxy to the list of those with which this handler communicates. Communication does not begin until the next call toMCMPHandler.status().Same as
addProxy(address, false.- Specified by:
addProxyin interfaceMCMPHandler- Parameters:
socketAddress- InetSocketAddress on which the proxy listens for MCMP requests
-
addProxy
Description copied from interface:MCMPHandlerAdd a proxy to the list of those with which this handler communicates. Communication does not begin until the next call toMCMPHandler.status().Same as
addProxy(proxyConfiguration, false).- Specified by:
addProxyin interfaceMCMPHandler- Parameters:
proxyConfiguration-ProxyConfigurationdefining address on which the proxy listens for MCMP requests and optional local address to bind connections to
-
addProxy
Deprecated.Description copied from interface:MCMPHandlerAdd a proxy to the list of those with which this handler communicates. Communication does not begin until the next call toMCMPHandler.status().- Specified by:
addProxyin interfaceMCMPHandler- Parameters:
socketAddress- InetSocketAddress on which the proxy listens for MCMP requestsestablished-trueif the proxy should be consideredestablished,falseotherwise.
-
addProxy
Description copied from interface:MCMPHandlerAdd a proxy to the list of those with which this handler communicates. Communication does not begin until the next call toMCMPHandler.status().- Specified by:
addProxyin interfaceMCMPHandler- Parameters:
proxyConfiguration-ProxyConfigurationdefining address on which the proxy listens for MCMP requests and optional local address to bind connections toestablished-trueif the proxy should be consideredestablished,falseotherwise.
-
removeProxy
Description copied from interface:MCMPHandlerRemove a proxy from the list of those with which this handler communicates. Communication does not end until the next call toMCMPHandler.status().- Specified by:
removeProxyin interfaceMCMPHandler- Parameters:
socketAddress- InetSocketAddress on which the proxy listens for MCMP requests
-
getProxyStates
Description copied from interface:MCMPHandlerGet the state of all proxies- Specified by:
getProxyStatesin interfaceMCMPHandler- Returns:
- a set of status objects indicating the status of this handler's communication with all proxies.
-
isProxyHealthOK
public boolean isProxyHealthOK()Description copied from interface:MCMPHandlerConvenience method that checks whether the status of all proxies isOK.- Specified by:
isProxyHealthOKin interfaceMCMPHandler- Returns:
trueif all proxies areOK,falseotherwise
-
markProxiesInError
public void markProxiesInError()Description copied from interface:MCMPHandlerReset any proxies whose status isOKdown toERROR, which will trigger a refresh of their configuration.- Specified by:
markProxiesInErrorin interfaceMCMPHandler
-
reset
public void reset()Description copied from interface:MCMPHandler- Specified by:
resetin interfaceMCMPHandler
-
status
public void status()Description copied from interface:MCMPHandlerPerform periodic processing. Update the list of proxies to reflect any calls toaddProxy(...)orremoveProxy(...). Attempt to establish communication with any proxies whose state isERROR. If successful and aResetRequestSourcehas been provided, update the proxy with the list of requests provided by the source.- Specified by:
statusin interfaceMCMPHandler
-
sendRequest
Description copied from interface:MCMPHandlerSend a request to all healthy proxies.- Specified by:
sendRequestin interfaceMCMPHandler- Parameters:
request- the request. Cannot benull
-
sendRequests
Description copied from interface:MCMPHandlerSend a list of requests to all healthy proxies, with all requests in the list sent to each proxy before moving on to the next.- Specified by:
sendRequestsin interfaceMCMPHandler- Parameters:
requests- the requests. Cannot benull
-