コード例 #1
0
  /** {@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());
      }
    }
  }
コード例 #2
0
 /**
  * @param name Plugin name.
  * @return Plugin provider.
  */
 @SuppressWarnings("unchecked")
 @Nullable
 public <T extends PluginProvider> T pluginProvider(String name) {
   return (T) plugins.get(name);
 }
コード例 #3
0
 /**
  * @param provider Plugin context.
  * @return Plugin context.
  */
 @SuppressWarnings("unchecked")
 public <T extends PluginContext> T pluginContextForProvider(PluginProvider provider) {
   return (T) pluginCtxMap.get(provider);
 }