use of org.apache.ignite.configuration.DefaultCommunicationFailureResolver in project ignite by apache.
the class GridDiscoveryManager method initCommunicationErrorResolveConfiguration.
/**
* @param cfg Configuration.
* @throws IgniteCheckedException If configuration is not valid.
*/
public static void initCommunicationErrorResolveConfiguration(IgniteConfiguration cfg) throws IgniteCheckedException {
CommunicationFailureResolver rslvr = cfg.getCommunicationFailureResolver();
CommunicationSpi commSpi = cfg.getCommunicationSpi();
DiscoverySpi discoverySpi = cfg.getDiscoverySpi();
if (rslvr != null) {
if (!supportsCommunicationErrorResolve(commSpi)) {
throw new IgniteCheckedException("CommunicationFailureResolver is configured, but CommunicationSpi does not support communication" + "problem resolve: " + commSpi.getClass().getName());
}
if (!supportsCommunicationErrorResolve(discoverySpi)) {
throw new IgniteCheckedException("CommunicationFailureResolver is configured, but DiscoverySpi does not support communication" + "problem resolve: " + discoverySpi.getClass().getName());
}
} else {
if (supportsCommunicationErrorResolve(commSpi) && supportsCommunicationErrorResolve(discoverySpi))
cfg.setCommunicationFailureResolver(new DefaultCommunicationFailureResolver());
}
}
Aggregations