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
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 Set<InetAddress> getAddresses()
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(InetAddress address)
public NetworkHealthCheck removeAddress(InetAddress address)
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(InetAddress address)
public boolean purePing(InetAddress address) throws IOException, InterruptedException
IOException
InterruptedException
public boolean check(URL url)
public boolean isEmpty()
Copyright © 2020 JBoss by Red Hat. All rights reserved.