Class NetworkHealthCheck
java.lang.Object
org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent
org.apache.activemq.artemis.core.server.NetworkHealthCheck
- All Implemented Interfaces:
Runnable,ActiveMQComponent
This will use
InetAddress.isReachable(int) to determine if the network is alive. It will have a set of
addresses, and if any address is reached the network will be considered alive.-
Field Summary
FieldsFields inherited from class org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent
executor, scheduledExecutorService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAddress(String straddress) addComponent(ActiveMQComponent component) booleancheck()Returns true if no checks were done or if one address/url responds; false if all addresses/urls fail.booleanbooleancheck(InetAddress address) booleanclearURL()intprotected ActiveMQThreadFactorygetUrls()booleanbooleanisEmpty()booleanprotected booleanisReachable(InetAddress address) parseAddressList(String addressList) parseURIList(String addressList) booleanpurePing(InetAddress address) removeAddress(String straddress) voidrun()setIgnoreLoopback(boolean ignoreLoopback) setIpv4Command(String ipv4Command) setIpv6Command(String ipv6Command) setNetworkTimeout(int networkTimeout) setNICName(String nicName) setPeriod(long period) setTimeUnit(TimeUnit timeUnit) Methods inherited from class org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent
delay, getInitialDelay, getPeriod, getTimeUnit, isStarted, setInitialDelay, setInitialDelayAndPeriod, setInitialDelayAndPeriod, setPeriod, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
Field Details
-
IPV6_DEFAULT_COMMAND
-
IPV4_DEFAULT_COMMAND
-
-
Constructor Details
-
NetworkHealthCheck
public NetworkHealthCheck() -
NetworkHealthCheck
-
-
Method Details
-
setNICName
-
isIgnoreLoopback
public boolean isIgnoreLoopback() -
setIgnoreLoopback
-
getAddresses
-
getUrls
-
getNICName
-
parseAddressList
-
parseURIList
-
getThreadFactory
- Overrides:
getThreadFactoryin classActiveMQScheduledComponent
-
getNetworkTimeout
public int getNetworkTimeout() -
setPeriod
- Overrides:
setPeriodin classActiveMQScheduledComponent
-
setTimeUnit
- Overrides:
setTimeUnitin classActiveMQScheduledComponent
-
setNetworkTimeout
-
addComponent
-
clearComponents
-
addAddress
-
removeAddress
-
clearAddresses
-
addURL
-
removeURL
-
clearURL
-
getIpv4Command
-
setIpv4Command
-
getIpv6Command
-
setIpv6Command
-
run
public void run() -
check
public boolean check()Returns true if no checks were done or if one address/url responds; false if all addresses/urls fail.- Returns:
- true if no checks were done or if one address/url responds; false if all addresses/urls fail
-
check
-
check
- Throws:
IOExceptionInterruptedException
-
isReachable
- Throws:
IOException
-
purePing
- Throws:
IOExceptionInterruptedException
-
check
-
isEmpty
public boolean isEmpty() -
hasCustomPingCommand
public boolean hasCustomPingCommand()
-