Class ModClusterListener
- java.lang.Object
-
- org.jboss.modcluster.config.impl.ModClusterConfig
-
- org.jboss.modcluster.container.tomcat.ModClusterListener
-
- All Implemented Interfaces:
org.apache.catalina.LifecycleListener,AdvertiseConfiguration,BalancerConfiguration,MCMPHandlerConfiguration,NodeConfiguration,SSLConfiguration,TomcatConnectorConfiguration,org.jboss.modcluster.load.LoadBalanceFactorProviderFactory,ModClusterServiceMBean
- Direct Known Subclasses:
ModClusterListener
public class ModClusterListener extends ModClusterConfig implements TomcatConnectorConfiguration, org.apache.catalina.LifecycleListener, org.jboss.modcluster.load.LoadBalanceFactorProviderFactory, ModClusterServiceMBean
Mod_cluster lifecycle listener for use in Tomcat.- Author:
- Paul Ferraro
-
-
Field Summary
-
Fields inherited from interface org.jboss.modcluster.config.AdvertiseConfiguration
DEFAULT_SOCKET_ADDRESS
-
-
Constructor Summary
Constructors Constructor Description ModClusterListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProxy(String host, int port)org.jboss.modcluster.load.LoadBalanceFactorProvidercreateLoadBalanceFactorProvider()booleandisable()booleandisableContext(String hostName, String contextPath)booleanenable()booleanenableContext(String hostName, String contextPath)StringgetAdvertiseGroupAddress()intgetAdvertisePort()StringgetConnectorAddress()Returns optional connector address.IntegergetConnectorPort()Returns optional connector port.StringgetExcludedContexts()StringgetExternalConnectorAddress()Returns optional external connector address.IntegergetExternalConnectorPort()Returns optional external connector port.intgetInitialLoad()Class<? extends JvmRouteFactory>getJvmRouteFactoryClass()floatgetLoadDecayFactor()Returns the factor by which the contribution of historical load values to the load factor calculation should exponentially decay.intgetLoadHistory()Returns the number of historic load values used when calculating the load factor.doublegetLoadMetricCapacity()StringgetLoadMetricClass()Returns the class name of the configured load metric.Map<InetSocketAddress,String>getProxyConfiguration()StringgetProxyConfigurationString()Map<InetSocketAddress,String>getProxyInfo()StringgetProxyInfoString()StringgetProxyList()voidlifecycleEvent(org.apache.catalina.LifecycleEvent event)Map<InetSocketAddress,String>ping()Map<InetSocketAddress,String>ping(String jvmRoute)Map<InetSocketAddress,String>ping(String scheme, String host, int port)voidrefresh()voidremoveProxy(String host, int port)voidreset()voidsetAdvertiseGroupAddress(String advertiseGroupAddress)voidsetAdvertiseInterface(String advertiseInterface)voidsetAdvertiseInterfaceName(String advertiseInterfaceName)voidsetAdvertisePort(int advertisePort)voidsetConnectorAddress(String connectorAddress)voidsetConnectorPort(int connectorPort)voidsetExcludedContexts(String contexts)voidsetExternalConnectorAddress(String externalConnectorAddress)voidsetExternalConnectorPort(int externalConnectorPort)voidsetInitialLoad(int initialLoad)voidsetJvmRouteFactoryClass(Class<? extends JvmRouteFactory> factoryClass)voidsetLoadDecayFactor(float decayFactor)Sets the factor by which the contribution of historical load values to the load factor calculation should exponentially decay.voidsetLoadDecayFactor(String decayFactor)String-based variant ofsetLoadDecayFactor(float)to set float decay factor used by Tomcat modeler.voidsetLoadHistory(int history)Sets the number of historic load values used when calculating the load factor.voidsetLoadMetricCapacity(String capacity)Sets the capacity (i.e.voidsetLoadMetricClass(String loadMetricClass)Sets the class of the desired load metricvoidsetProxyList(String addresses)voidsetSessionDrainingStrategy(String sessionDrainingStrategy)booleanstop(long timeout)booleanstop(long timeout, TimeUnit unit)booleanstopContext(String host, String path, long timeout)booleanstopContext(String host, String path, long timeout, TimeUnit unit)-
Methods inherited from class org.jboss.modcluster.config.impl.ModClusterConfig
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, 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
-
-
-
-
Method Detail
-
createLoadBalanceFactorProvider
public org.jboss.modcluster.load.LoadBalanceFactorProvider createLoadBalanceFactorProvider()
- Specified by:
createLoadBalanceFactorProviderin interfaceorg.jboss.modcluster.load.LoadBalanceFactorProviderFactory
-
lifecycleEvent
public void lifecycleEvent(org.apache.catalina.LifecycleEvent event)
- Specified by:
lifecycleEventin interfaceorg.apache.catalina.LifecycleListener
-
getJvmRouteFactoryClass
public Class<? extends JvmRouteFactory> getJvmRouteFactoryClass()
-
setJvmRouteFactoryClass
public void setJvmRouteFactoryClass(Class<? extends JvmRouteFactory> factoryClass)
-
getLoadMetricClass
public String getLoadMetricClass()
Returns the class name of the configured load metric.- Returns:
- the name of a class implementing
LoadMetric
-
setLoadMetricClass
public void setLoadMetricClass(String loadMetricClass)
Sets the class of the desired load metric- Parameters:
loadMetricClass- a class implementingLoadMetric- Throws:
IllegalArgumentException- if metric class could not be loaded
-
getLoadDecayFactor
public float getLoadDecayFactor()
Returns the factor by which the contribution of historical load values to the load factor calculation should exponentially decay.- Returns:
- the configured load decay factor
-
setLoadDecayFactor
public void setLoadDecayFactor(float decayFactor)
Sets the factor by which the contribution of historical load values to the load factor calculation should exponentially decay.- Parameters:
decayFactor- a positive number
-
setLoadDecayFactor
public void setLoadDecayFactor(String decayFactor)
String-based variant ofsetLoadDecayFactor(float)to set float decay factor used by Tomcat modeler.- Parameters:
decayFactor- a positive number
-
getLoadHistory
public int getLoadHistory()
Returns the number of historic load values used when calculating the load factor.- Returns:
- the configured load history
-
setLoadHistory
public void setLoadHistory(int history)
Sets the number of historic load values used when calculating the load factor.- Parameters:
history-
-
getLoadMetricCapacity
public double getLoadMetricCapacity()
-
setLoadMetricCapacity
public void setLoadMetricCapacity(String capacity)
Sets the capacity (i.e. maximum expected value) of the load values returned by the load metric specified bygetLoadMetricClass()- Parameters:
capacity- a load capacity
-
getInitialLoad
public int getInitialLoad()
-
setInitialLoad
public void setInitialLoad(int initialLoad)
-
addProxy
public void addProxy(String host, int port)
- Specified by:
addProxyin interfaceModClusterServiceMBean
-
disable
public boolean disable()
- Specified by:
disablein interfaceModClusterServiceMBean
-
disableContext
public boolean disableContext(String hostName, String contextPath)
- Specified by:
disableContextin interfaceModClusterServiceMBean
-
ping
public Map<InetSocketAddress,String> ping()
- Specified by:
pingin interfaceModClusterServiceMBean
-
ping
public Map<InetSocketAddress,String> ping(String jvmRoute)
- Specified by:
pingin interfaceModClusterServiceMBean
-
ping
public Map<InetSocketAddress,String> ping(String scheme, String host, int port)
- Specified by:
pingin interfaceModClusterServiceMBean
-
enable
public boolean enable()
- Specified by:
enablein interfaceModClusterServiceMBean
-
enableContext
public boolean enableContext(String hostName, String contextPath)
- Specified by:
enableContextin interfaceModClusterServiceMBean
-
getProxyConfiguration
public Map<InetSocketAddress,String> getProxyConfiguration()
- Specified by:
getProxyConfigurationin interfaceModClusterServiceMBean
-
getProxyInfo
public Map<InetSocketAddress,String> getProxyInfo()
- Specified by:
getProxyInfoin interfaceModClusterServiceMBean
-
refresh
public void refresh()
- Specified by:
refreshin interfaceModClusterServiceMBean
-
removeProxy
public void removeProxy(String host, int port)
- Specified by:
removeProxyin interfaceModClusterServiceMBean
-
reset
public void reset()
- Specified by:
resetin interfaceModClusterServiceMBean
-
stop
public boolean stop(long timeout, TimeUnit unit)- Specified by:
stopin interfaceModClusterServiceMBean
-
stopContext
public boolean stopContext(String host, String path, long timeout, TimeUnit unit)
- Specified by:
stopContextin interfaceModClusterServiceMBean
-
getProxyConfigurationString
public String getProxyConfigurationString()
-
getProxyInfoString
public String getProxyInfoString()
-
stop
public boolean stop(long timeout)
-
getConnectorAddress
public String getConnectorAddress()
Description copied from interface:TomcatConnectorConfigurationReturns optional connector address.- Specified by:
getConnectorAddressin interfaceTomcatConnectorConfiguration- Returns:
- connector address
-
setConnectorAddress
public void setConnectorAddress(String connectorAddress)
-
getConnectorPort
public Integer getConnectorPort()
Description copied from interface:TomcatConnectorConfigurationReturns optional connector port.- Specified by:
getConnectorPortin interfaceTomcatConnectorConfiguration- Returns:
- connector port
-
setConnectorPort
public void setConnectorPort(int connectorPort)
-
getExternalConnectorAddress
public String getExternalConnectorAddress()
Description copied from interface:TomcatConnectorConfigurationReturns optional external connector address.- Specified by:
getExternalConnectorAddressin interfaceTomcatConnectorConfiguration- Returns:
- connector address
-
setExternalConnectorAddress
public void setExternalConnectorAddress(String externalConnectorAddress)
-
getExternalConnectorPort
public Integer getExternalConnectorPort()
Description copied from interface:TomcatConnectorConfigurationReturns optional external connector port.- Specified by:
getExternalConnectorPortin interfaceTomcatConnectorConfiguration- Returns:
- connector port
-
setExternalConnectorPort
public void setExternalConnectorPort(int externalConnectorPort)
-
getAdvertiseGroupAddress
public String getAdvertiseGroupAddress()
-
setAdvertiseGroupAddress
public void setAdvertiseGroupAddress(String advertiseGroupAddress)
-
getAdvertisePort
public int getAdvertisePort()
-
setAdvertisePort
public void setAdvertisePort(int advertisePort)
-
setAdvertiseInterface
public void setAdvertiseInterface(String advertiseInterface)
-
setAdvertiseInterfaceName
public void setAdvertiseInterfaceName(String advertiseInterfaceName)
-
setProxyList
public void setProxyList(String addresses)
-
getProxyList
public String getProxyList()
-
setExcludedContexts
public void setExcludedContexts(String contexts)
-
getExcludedContexts
public String getExcludedContexts()
-
setSessionDrainingStrategy
public void setSessionDrainingStrategy(String sessionDrainingStrategy)
-
-