Class HeartbeatListener
java.lang.Object
org.apache.catalina.ha.backend.HeartbeatListener
- All Implemented Interfaces:
LifecycleListener
Lifecycle listener that provides heartbeat information to mod_heartbeat for Apache HTTP Server.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringHost of the connector to proxy.protected StringMulticast IP address.protected intMulticast port.protected intPort of the connector to proxy.protected StringProxy list, format "address:port,address:port".protected StringURL prefix.protected intTime-to-live for multicast packets. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetGroup()Get the multicast IP address used for sending heartbeat messages.getHost()Get the host corresponding to the connector we want to proxy.intGet the multicast port used for sending heartbeat messages.intgetPort()Get the port of the connector we want to proxy.Get the list of proxies that send requests to this server.Get the URL specified in <Location/> for the SetHandler heartbeat in httpd.conf.intgetTtl()Get the TTL value used for multicast packets.voidlifecycleEvent(LifecycleEvent event) Acknowledge the occurrence of the specified event.voidSet the Multicast IP to use for MulticastvoidSet the host corresponding to the connector.voidsetMultiport(int port) Set the Port to use for MulticastvoidsetPort(int port) Set the port corresponding to the connector.voidsetProxyList(String proxyList) Set the list of Proxies that send is requests, when not empty it toggles the multi to off.voidsetProxyURLString(String proxyURL) Set the URL of receiver in httpd.voidsetTtl(int ttl) Set the TTL for Multicast packets.
-
Field Details
-
port
protected int portPort of the connector to proxy. Default is 8009. -
host
Host of the connector to proxy. -
ip
Multicast IP address. Default is 224.0.1.105. -
multiport
protected int multiportMulticast port. Default is 23364. -
ttl
protected int ttlTime-to-live for multicast packets. Default is 16. -
proxyList
Proxy list, format "address:port,address:port". -
proxyURL
URL prefix.
-
-
Constructor Details
-
HeartbeatListener
public HeartbeatListener()Constructs a new HeartbeatListener.
-
-
Method Details
-
getHost
Get the host corresponding to the connector we want to proxy.- Returns:
- the host
-
setHost
Set the host corresponding to the connector.- Parameters:
host- the hostname or ip string.
-
getPort
public int getPort()Get the port of the connector we want to proxy.- Returns:
- the port
-
setPort
public void setPort(int port) Set the port corresponding to the connector.- Parameters:
port- default 8009 the ajp one.
-
getGroup
Get the multicast IP address used for sending heartbeat messages.- Returns:
- the multicast IP address
-
setGroup
Set the Multicast IP to use for Multicast- Parameters:
group- the multi address to use.
-
getMultiport
public int getMultiport()Get the multicast port used for sending heartbeat messages.- Returns:
- the multicast port
-
setMultiport
public void setMultiport(int port) Set the Port to use for Multicast- Parameters:
port- the port to use.
-
getTtl
public int getTtl()Get the TTL value used for multicast packets.- Returns:
- the TTL value
-
setTtl
public void setTtl(int ttl) Set the TTL for Multicast packets.- Parameters:
ttl- value for TTL.
-
getProxyList
Get the list of proxies that send requests to this server.- Returns:
- the proxy list in "address:port,address:port" format
-
setProxyList
Set the list of Proxies that send is requests, when not empty it toggles the multi to off. A SetHandler heartbeat must be existing in httpd.conf.- Parameters:
proxyList- the list of proxy, format "address:port,address:port".
-
getProxyURL
Get the URL specified in <Location/> for the SetHandler heartbeat in httpd.conf.- Returns:
- the proxy URL
-
setProxyURLString
Set the URL of receiver in httpd. That is the location used in<Location "/HeartbeatListener"> SetHandler heartbeat </Location>
All proxies MUST use the same location.- Parameters:
proxyURL- a String with the URL starting with /
-
lifecycleEvent
Description copied from interface:LifecycleListenerAcknowledge the occurrence of the specified event.- Specified by:
lifecycleEventin interfaceLifecycleListener- Parameters:
event- LifecycleEvent that has occurred
-