public class NetworkHealthCheck extends ActiveMQScheduledComponent
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.Modifier and Type | Field and Description |
---|---|
static String |
IPV4_DEFAULT_COMMAND |
static String |
IPV6_DEFAULT_COMMAND |
Constructor and Description |
---|
NetworkHealthCheck() |
NetworkHealthCheck(String nicName,
long checkPeriod,
int networkTimeout) |
delay, getInitialDelay, getPeriod, getTimeUnit, isStarted, setInitialDelay, setInitialDelayAndPeriod, setInitialDelayAndPeriod, setPeriod, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asyncStop
public static final String IPV6_DEFAULT_COMMAND
public static final String IPV4_DEFAULT_COMMAND
public NetworkHealthCheck()
public NetworkHealthCheck(String nicName, long checkPeriod, int networkTimeout)
public NetworkHealthCheck setNICName(String nicName)
public boolean isIgnoreLoopback()
public NetworkHealthCheck setIgnoreLoopback(boolean ignoreLoopback)
public String getNICName()
public NetworkHealthCheck parseAddressList(String addressList)
public NetworkHealthCheck parseURIList(String addressList)
protected ActiveMQThreadFactory getThreadFactory()
getThreadFactory
in class ActiveMQScheduledComponent
public int getNetworkTimeout()
public NetworkHealthCheck setPeriod(long period)
setPeriod
in class ActiveMQScheduledComponent
public NetworkHealthCheck setTimeUnit(TimeUnit timeUnit)
setTimeUnit
in class ActiveMQScheduledComponent
public NetworkHealthCheck setNetworkTimeout(int networkTimeout)
public NetworkHealthCheck addComponent(ActiveMQComponent component)
public NetworkHealthCheck clearComponents()
public NetworkHealthCheck addAddress(String straddress)
public NetworkHealthCheck removeAddress(String straddress)
public NetworkHealthCheck clearAddresses()
public NetworkHealthCheck addURL(URL url)
public NetworkHealthCheck removeURL(URL url)
public NetworkHealthCheck clearURL()
public String getIpv4Command()
public NetworkHealthCheck setIpv4Command(String ipv4Command)
public String getIpv6Command()
public NetworkHealthCheck setIpv6Command(String ipv6Command)
public void run()
public boolean check()
public boolean check(String straddress)
public boolean check(InetAddress address) throws IOException, InterruptedException
IOException
InterruptedException
protected boolean isReachable(InetAddress address) throws IOException
IOException
public boolean purePing(InetAddress address) throws IOException, InterruptedException
IOException
InterruptedException
public boolean check(URL url)
public boolean isEmpty()
public boolean hasCustomPingCommand()
Copyright © 2021 JBoss by Red Hat. All rights reserved.