/** {@inheritDoc} */ @Override public void onDiscoveryDataReceived(UUID nodeId, UUID rmtNodeId, Serializable data) { Map<String, Serializable> discData = (Map<String, Serializable>) data; if (discData != null) { for (Map.Entry<String, Serializable> e : discData.entrySet()) { PluginProvider provider = plugins.get(e.getKey()); if (provider != null) provider.receiveDiscoveryData(nodeId, e.getValue()); else U.warn(log, "Received discovery data for unknown plugin: " + e.getKey()); } } }
/** * @param name Plugin name. * @return Plugin provider. */ @SuppressWarnings("unchecked") @Nullable public <T extends PluginProvider> T pluginProvider(String name) { return (T) plugins.get(name); }
/** * @param provider Plugin context. * @return Plugin context. */ @SuppressWarnings("unchecked") public <T extends PluginContext> T pluginContextForProvider(PluginProvider provider) { return (T) pluginCtxMap.get(provider); }