Пример #1
0
  /**
   * Returns the array of components bound the "multicastItfName" multicast interface, or null if it
   * fails to getting them.
   *
   * @param component The client component
   * @param multicastItfName The name of the multicast interface
   * @return Array of bound components, or null if it fails
   */
  public static Component[] getMulticastBindComponenents(
      Component component, String multicastItfName) {
    try {
      Object[] destinationItfs =
          Utils.getPAMulticastController(component).lookupGCMMulticast(multicastItfName);
      Component[] destinationComps = new Component[destinationItfs.length];

      for (int i = 0; i < destinationItfs.length; i++) {
        destinationComps[i] = ((PAInterface) destinationItfs[i]).getFcItfOwner();
      }

      return destinationComps;

    } catch (NoSuchInterfaceException e) {
      e.printStackTrace();
      return null;
    }
  }