/**
   * Loads socket-bindings, which are already defined in fresh standalone files.
   *
   * @param ctx migration context
   * @throws LoadMigrationException if unmarshalling socket-bindings from standalone file fails
   */
  private void createDefaultSockets(MigrationContext ctx, ServerMigratorResource resource)
      throws LoadMigrationException {
    try {
      Unmarshaller unmarshaller =
          JAXBContext.newInstance(SocketBindingBean.class).createUnmarshaller();

      // TODO:  Read over Management API. MIGR-71
      NodeList bindings = ctx.getAS7ConfigXmlDoc().getElementsByTagName("socket-binding");
      for (int i = 0; i < bindings.getLength(); i++) {
        if (!(bindings.item(i) instanceof Element)) {
          continue;
        }
        SocketBindingBean socketBinding =
            (SocketBindingBean) unmarshaller.unmarshal(bindings.item(i));
        if ((socketBinding.getSocketName() != null) || (socketBinding.getSocketPort() != null)) {
          resource.getSocketTemp().add(socketBinding);
        }
      }
    } catch (JAXBException e) {
      throw new LoadMigrationException(
          "Parsing of socket-bindings in standalone file failed: " + e.getMessage(), e);
    }
  }