public class ModClusterListener extends ModClusterConfig implements TomcatConnectorConfiguration, org.apache.catalina.LifecycleListener, LoadBalanceFactorProviderFactory, ModClusterServiceMBean
DEFAULT_SOCKET_ADDRESS
Modifier | Constructor and Description |
---|---|
|
ModClusterListener() |
protected |
ModClusterListener(ModClusterServiceMBean mbean,
org.apache.catalina.LifecycleListener listener) |
Modifier and Type | Method and Description |
---|---|
void |
addProxy(String host,
int port)
Add a proxy to the list of those with which this handler communicates.
|
LoadBalanceFactorProvider |
createLoadBalanceFactorProvider() |
boolean |
disable()
Disable all webapps for all engines.
|
boolean |
disableContext(String hostName,
String contextPath)
Disables the webapp with the specified host and context path.
|
boolean |
enable()
Enable all webapps for all engines.
|
boolean |
enableContext(String hostName,
String contextPath)
Enables the webapp with the specified host and context path.
|
String |
getAdvertiseGroupAddress() |
int |
getAdvertisePort() |
String |
getConnectorAddress()
Returns optional connector address.
|
Integer |
getConnectorPort()
Returns optional connector port.
|
String |
getExcludedContexts() |
int |
getInitialLoad() |
Class<? extends JvmRouteFactory> |
getJvmRouteFactoryClass() |
float |
getLoadDecayFactor()
Returns the factor by which the contribution of historical load values to the load factor calculation should
exponentially decay.
|
int |
getLoadHistory()
Returns the number of historic load values used when calculating the load factor.
|
double |
getLoadMetricCapacity() |
String |
getLoadMetricClass()
Returns the class name of the configured load metric.
|
Map<InetSocketAddress,String> |
getProxyConfiguration()
Retrieves the full proxy configuration.
|
String |
getProxyConfigurationString() |
Map<InetSocketAddress,String> |
getProxyInfo()
Retrieves the full proxy info message.
|
String |
getProxyInfoString() |
String |
getProxyList() |
void |
lifecycleEvent(org.apache.catalina.LifecycleEvent event) |
Map<InetSocketAddress,String> |
ping()
Ping httpd.
|
Map<InetSocketAddress,String> |
ping(String jvmRoute)
Ping a node from httpd.
|
Map<InetSocketAddress,String> |
ping(String scheme,
String host,
int port)
Ping a node defined protocol, host and port from httpd.
|
void |
refresh()
Refresh configuration.
|
void |
removeProxy(String host,
int port)
Remove a proxy from the list of those with which this handler communicates.
|
void |
reset()
Reset a DOWN connection to the proxy up to ERROR, where the configuration will be refreshed.
|
void |
setAdvertiseGroupAddress(String advertiseGroupAddress) |
void |
setAdvertiseInterface(String advertiseInterface) |
void |
setAdvertisePort(int advertisePort) |
void |
setConnectorAddress(String connectorAddress) |
void |
setConnectorPort(int connectorPort) |
void |
setExcludedContexts(String contexts) |
void |
setInitialLoad(int initialLoad) |
void |
setJvmRouteFactoryClass(Class<? extends JvmRouteFactory> factoryClass) |
void |
setLoadDecayFactor(float decayFactor)
Sets the factor by which the contribution of historical load values to the load factor calculation should exponentially
decay.
|
void |
setLoadDecayFactor(String decayFactor)
String-based variant of
setLoadDecayFactor(float) to set float decay factor used by Tomcat modeler. |
void |
setLoadHistory(int history)
Sets the number of historic load values used when calculating the load factor.
|
void |
setLoadMetricCapacity(String capacity)
Sets the capacity (i.e.
|
void |
setLoadMetricClass(String loadMetricClass)
Sets the class of the desired load metric
|
void |
setProxyList(String addresses) |
void |
setSessionDrainingStrategy(String sessionDrainingStrategy) |
boolean |
stop(long timeout) |
boolean |
stop(long timeout,
TimeUnit unit)
Attempts to gracefully stops all web applications, within the specified timeout.
|
boolean |
stopContext(String host,
String path,
long timeout) |
boolean |
stopContext(String host,
String path,
long timeout,
TimeUnit unit)
Attempts to gracefully stops a single web application, within the specified timeout.
|
getAdvertise, getAdvertiseInterface, getAdvertiseSecurityKey, getAdvertiseSocketAddress, getAdvertiseThreadFactory, getBalancer, getExcludedContextsPerHost, getFlushPackets, getFlushWait, getJvmRouteFactory, getLoadBalancingGroup, getMaxAttempts, getNodeTimeout, getPing, getProxies, getProxyConfigurations, getProxyURL, getSessionDrainingStrategy, getSmax, getSocketFactory, getSocketTimeout, getSslCertificateEncodingAlgorithm, getSslCiphers, getSslCrlFile, getSslKeyAlias, getSslKeyStore, getSslKeyStorePassword, getSslKeyStoreProvider, getSslKeyStoreType, getSslProtocol, getSslTrustAlgorithm, getSslTrustMaxCertLength, getSslTrustStore, getSslTrustStorePassword, getSslTrustStoreProvider, getSslTrustStoreType, getStickySession, getStickySessionForce, getStickySessionRemove, getStopContextTimeout, getStopContextTimeoutUnit, getTtl, getWorkerTimeout, isAutoEnableContexts, isSsl, setAdvertise, setAdvertiseInterface, setAdvertiseSecurityKey, setAdvertiseSocketAddress, setAdvertiseThreadFactory, setAutoEnableContexts, setBalancer, setExcludedContextsPerHost, setFlushPackets, setFlushWait, setJvmRouteFactory, setLoadBalancingGroup, setMaxAttempts, setNodeTimeout, setPing, setProxies, setProxyConfigurations, setProxyURL, setSessionDrainingStrategy, setSmax, setSocketTimeout, setSsl, setSslCertificateEncodingAlgorithm, setSslCiphers, setSslCrlFile, setSslKeyAlias, setSslKeyStore, setSslKeyStorePassword, setSslKeyStoreProvider, setSslKeyStoreType, setSslProtocol, setSslTrustAlgorithm, setSslTrustMaxCertLength, setSslTrustStore, setSslTrustStorePassword, setSslTrustStoreProvider, setSslTrustStoreType, setStickySession, setStickySessionForce, setStickySessionRemove, setStopContextTimeout, setStopContextTimeoutUnit, setTtl, setWorkerTimeout
public ModClusterListener()
protected ModClusterListener(ModClusterServiceMBean mbean, org.apache.catalina.LifecycleListener listener)
public LoadBalanceFactorProvider createLoadBalanceFactorProvider()
createLoadBalanceFactorProvider
in interface LoadBalanceFactorProviderFactory
public void lifecycleEvent(org.apache.catalina.LifecycleEvent event)
lifecycleEvent
in interface org.apache.catalina.LifecycleListener
public Class<? extends JvmRouteFactory> getJvmRouteFactoryClass()
public void setJvmRouteFactoryClass(Class<? extends JvmRouteFactory> factoryClass)
public String getLoadMetricClass()
LoadMetric
public void setLoadMetricClass(String loadMetricClass)
loadMetricClass
- a class implementing LoadMetric
IllegalArgumentException
- if metric class could not be loadedpublic float getLoadDecayFactor()
public void setLoadDecayFactor(float decayFactor)
decayFactor
- a positive numberpublic void setLoadDecayFactor(String decayFactor)
setLoadDecayFactor(float)
to set float decay factor used by Tomcat modeler.decayFactor
- a positive numberpublic int getLoadHistory()
public void setLoadHistory(int history)
history
- public double getLoadMetricCapacity()
public void setLoadMetricCapacity(String capacity)
getLoadMetricClass()
capacity
- a load capacitypublic int getInitialLoad()
public void setInitialLoad(int initialLoad)
public void addProxy(String host, int port)
ModClusterServiceMBean
MCMPHandler.status()
.addProxy
in interface ModClusterServiceMBean
host
- the hostname of the proxy; a string suitable for passing to InetAddress.getByHost(...)
port
- the port on which the proxy listens for MCMP requestspublic boolean disable()
ModClusterServiceMBean
disable
in interface ModClusterServiceMBean
public boolean disableContext(String hostName, String contextPath)
ModClusterServiceMBean
disableContext
in interface ModClusterServiceMBean
hostName
- host name of the target webappcontextPath
- context path of the target webapppublic Map<InetSocketAddress,String> ping()
ModClusterServiceMBean
ping
in interface ModClusterServiceMBean
public Map<InetSocketAddress,String> ping(String jvmRoute)
ModClusterServiceMBean
ping
in interface ModClusterServiceMBean
jvmRoute
- a jvm route.public Map<InetSocketAddress,String> ping(String scheme, String host, int port)
ModClusterServiceMBean
ping
in interface ModClusterServiceMBean
scheme
- ajp, http or httpshost
- name or IP of a the hostpublic boolean enable()
ModClusterServiceMBean
enable
in interface ModClusterServiceMBean
public boolean enableContext(String hostName, String contextPath)
ModClusterServiceMBean
enableContext
in interface ModClusterServiceMBean
hostName
- host name of the target webappcontextPath
- context path of the target webapppublic Map<InetSocketAddress,String> getProxyConfiguration()
ModClusterServiceMBean
DUMP
request to all proxies, returning the responses grouped by proxy address.getProxyConfiguration
in interface ModClusterServiceMBean
public Map<InetSocketAddress,String> getProxyInfo()
ModClusterServiceMBean
INFO
request to all proxies, returning the responses grouped by proxy address.getProxyInfo
in interface ModClusterServiceMBean
public void refresh()
ModClusterServiceMBean
refresh
in interface ModClusterServiceMBean
public void removeProxy(String host, int port)
ModClusterServiceMBean
MCMPHandler.status()
.removeProxy
in interface ModClusterServiceMBean
host
- the hostname of the proxy; a string suitable for passing to InetAddress.getByHost(...)
port
- the port on which the proxy listens for MCMP requestspublic void reset()
ModClusterServiceMBean
reset
in interface ModClusterServiceMBean
public boolean stop(long timeout, TimeUnit unit)
ModClusterServiceMBean
stop
in interface ModClusterServiceMBean
timeout
- number of units of time for which to wait for sessions to drain. Negative or zero timeout value will wait
forever.unit
- unit of time represented in timeout parameterpublic boolean stopContext(String host, String path, long timeout, TimeUnit unit)
ModClusterServiceMBean
stopContext
in interface ModClusterServiceMBean
timeout
- number of units of time for which to wait for sessions to drain. Negative or zero timeout value will wait
forever.unit
- unit of time represented in timeout parameterpublic String getProxyConfigurationString()
public String getProxyInfoString()
public boolean stop(long timeout)
public String getConnectorAddress()
TomcatConnectorConfiguration
getConnectorAddress
in interface TomcatConnectorConfiguration
public void setConnectorAddress(String connectorAddress)
public Integer getConnectorPort()
TomcatConnectorConfiguration
getConnectorPort
in interface TomcatConnectorConfiguration
public void setConnectorPort(int connectorPort)
public String getAdvertiseGroupAddress()
public void setAdvertiseGroupAddress(String advertiseGroupAddress)
public int getAdvertisePort()
public void setAdvertisePort(int advertisePort)
public void setAdvertiseInterface(String advertiseInterface)
public void setProxyList(String addresses)
public String getProxyList()
public void setExcludedContexts(String contexts)
public String getExcludedContexts()
public void setSessionDrainingStrategy(String sessionDrainingStrategy)
Copyright © 2023 JBoss by Red Hat. All rights reserved.