code: private void invokeDestroy(String method, String name) {
          Class clazz = this.jmsServerManager().getClass();
          Method destroy = null;
          for (Method each: clazz.getMethods()) {
              if (method.equals(each.getName())) {
                  destroy = each;
                  break;
              }
          }
  
          if (destroy == null) {
              throw new IllegalStateException(String.format("Class %s has no %s method", clazz, method));
          }
  
          try {
              if (destroy.getParameterTypes().length == 1) {
                  destroy.invoke(this.jmsServerManager(), name);
              } else {
                  destroy.invoke(this.jmsServerManager(), name, true);
              }
          } catch (IllegalAccessException | InvocationTargetException e) {
              throw new RuntimeException("Failed to destroy destination " + name, e);
          }
      }
docs: HornetQ 2.3 has single-arity destroy functions, 2.4 has double-arity