@Override
  public void execute(FunctionContext fc) {

    boolean executedSuccessfully = false;

    InternalCache cache = ((InternalCache) fc.getCache()).getCacheForProcessingClientRequests();

    Object[] functionArguments = (Object[]) fc.getArguments();

    ObjectName objectName = (ObjectName) functionArguments[0];

    String methodName = (String) functionArguments[1];

    String[] signature = (String[]) functionArguments[2];

    Object[] args = (Object[]) functionArguments[3];
    String memberName = (String) functionArguments[4];

    Object returnObj = null;

    try {

      final int nargs = (args == null) ? 0 : args.length;

      if (methodName.startsWith("set") && methodName.length() > 3 && nargs == 1) {

        Attribute attr = new Attribute(methodName.substring(3), args[0]);
        mbeanServer.setAttribute(objectName, attr);
        fc.getResultSender().lastResult(null);

      } else if (methodName.equals("addNotificationListener")) {
        notificationHub.addHubNotificationListener(memberName, objectName);
        fc.getResultSender().lastResult(ManagementConstants.UNDEFINED);

      } else if (methodName.equals("removeNotificationListener")) {
        notificationHub.removeHubNotificationListener(memberName, objectName);
        fc.getResultSender().lastResult(ManagementConstants.UNDEFINED);

      } else if (methodName.equals("getNotificationInfo")) {
        fc.getResultSender().lastResult(mbeanServer.getMBeanInfo(objectName));

      } else {
        returnObj = mbeanServer.invoke(objectName, methodName, args, signature);
        fc.getResultSender().lastResult(returnObj);
      }

      executedSuccessfully = true;

    } catch (InstanceNotFoundException e) {
      if (cache != null && !cache.isClosed()) {
        sendException(e, fc);
      }
    } catch (Exception e) {
      sendException(e, fc);
    } finally {
      if (!executedSuccessfully) {
        if (cache == null || cache.isClosed()) {
          Exception e =
              new Exception("Member Is Shutting down");
          sendException(e, fc);
          return; // member is closing or invalid member
        }
      }
    }
  }
Actual function execution. It delegates task at managed node according to the request received.

If any exception is encountered it will set the result to UNDEFINED
geode-core/src/main/java/org/apache/geode/management/internal/ManagementFunction.java