Execute an operation on an mbean.

@param formParams
@param key
@param jsonp
@param name
186360
@POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Path("{key}/{op}")
    public Response invokeMbeanOperation(
            MultivaluedMap<String, String> formParams,
            @PathParam("key") String key, @QueryParam("jsonp") String jsonp,
            @PathParam("op") String name) throws Exception {

        LOG.info("invoke " + key + " op=" + name);
        MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
        Map<String, String> params = new TreeMap<String, String>();
        for (Entry<String, List<String>> entry : formParams.entrySet()) {
            if (entry.getKey().equals("op"))
                continue;
            if (entry.getValue().size() > 0)
                params.put(entry.getKey(), entry.getValue().get(0));
            else
                params.put(entry.getKey(), "");
        }

        ObjectName objName = new ObjectName(key);
        MBeanInfo info = mBeanServer.getMBeanInfo(objName);
        for (MBeanOperationInfo op : info.getOperations()) {
            if (op.getName().equals(name)) {
                List<String> signature = new ArrayList<String>();
                for (MBeanParameterInfo s : op.getSignature()) {
                    signature.add(s.getType());
                }
                Object result = mBeanServer.invoke(objName, name, params
                        .values().toArray(new String[params.size()]), signature
                        .toArray(new String[signature.size()]));
                JSONObject json = new JSONObject();
                json.put("key", key);
                json.put("operation", name);
                if (result != null) {
                    json.put("response", result.toString());
                }
                json.put("type", op.getReturnType());

                StringWriter out = new StringWriter();
                if (jsonp.isEmpty()) {
                    json.write(out);
                } else {
                    out.append(jsonp).append("(");
                    json.write(out);
                    out.append(");");
                }
                return Response.ok(out.toString())
                        .type(MediaType.APPLICATION_JSON).build();
            }
        }

        return Response.serverError().build();
    }
978537
public RequestBody buildRequestBodyFormEncoding(Map<String, Object> formParams) {
        FormEncodingBuilder formBuilder  = new FormEncodingBuilder();
        for (Entry<String, Object> param : formParams.entrySet()) {
            formBuilder.add(param.getKey(), parameterToString(param.getValue()));
        }
        return formBuilder.build();
    }
1359172
function (methodName, params, execOptions) {
                var requestId = this._getRequestId(methodName, params);
                var promise = this._getRequestPromise(requestId);

                if (!promise) {
                    this._addToBatch(methodName, params);
                    promise = this._createPromise(requestId);
                    this._run(execOptions);
                }

                return promise;
            }
1021042
public void error(String key, Object... params) {
        Tr.error(tc, key, params);
    }
182498
public static void setStateParam(String name, String value, HttpServletRequest req,
			HttpServletResponse res, boolean httpOnly) {
		setRawCookie(name, value, req, res, httpOnly, -1);
	}
487582
@SuppressWarnings("unchecked")
    private void updateMap(Map<String, Object> parentMap, String paramName, Object paramValue) {
        Object currentValue = parentMap.get(paramName);
        if (currentValue == null || !(currentValue instanceof Map)) {
            if (paramValue instanceof Map) {
                parentMap.put(paramName, paramValue);
            } else {
                parentMap.put(paramName, paramValue.toString());
            }
        } else {
            Utils.require(paramValue instanceof Map,
                          "Parameter '%s' must be a map: %s", paramName, paramValue.toString());
            Map<String, Object> currentMap = (Map<String, Object>)currentValue;
            Map<String, Object> updateMap = (Map<String, Object>)paramValue;
            for (String subParam : updateMap.keySet()) {
                updateMap(currentMap, subParam, updateMap.get(subParam));
            }
        }
    }
525148
private static void setParams(Map<String, ?> map) {
        for (String name : map.keySet()) {
            setParam(name, map.get(name));
        }
    }
1360563
public void visitParameter(String name, int access) {
        if (mv != null) {
            mv.visitParameter(name, access);
        }
    }
1062678
protected void doPostForm(String path, MultivaluedMap<String, String> formParams) throws ClientException {
        doPostForm(path, formParams, null);
    }
1192202
public boolean execute(Map<String, String> params, String query) {
        final AtomicBoolean result = new AtomicBoolean(false);
        Tuple2<DataSource, Connection> conn = null;
        try {
            conn = getConnection();
            NamedParameterJdbcTemplate jdbcTemplate = new NamedParameterJdbcTemplate(conn._1());
            jdbcTemplate.execute(query, params, new PreparedStatementCallback<Void>() {
                @Override
                public Void doInPreparedStatement(PreparedStatement ps) {
                    try {
                        result.set(ps.execute());
                    } catch(SQLException e) {
                        result.set(false);
                    }
                    return null;
                }
            });
        } catch (Exception ex) {
            Logger.getLogger(MysqlAccessor.class.getName()).log(Level.SEVERE, null, ex);
            result.set(false);
        } finally {
            returnConnection(conn);
        }
        return result.get();
    }
334110
<T extends Validatable> void validatePOJO(final T pojo, final String name) {
    try {
      pojo.validate();
    } catch (final IllegalArgumentException e) {
      throw new IllegalArgumentException("Invalid " + name, e);
    }
  }
372493
public DescriptionBuilder mapping(final String key, final String name) {
        mapping.put(key, name);
        return this;
    }
1038114
public Map<String, Object> executeForMap(int sqlId, Map<String, ? extends Object> bindParams) {
      String sql = context.getResources().getString(sqlId);
      return executeForMap(sql, bindParams);
   }
1236263
private function checkValidationQueueErrors(string $paramName): void
    {
        if ($this->getValidationErrors()->count() > 0) {
            foreach ($this->getValidationErrors()->get() as $error) {
                $this->getJsonErrors()->addValidationQueryError($paramName, $error);
            }

            throw new JsonApiException($this->getJsonErrors());
        }
    }
451555
function(method, formOpts, callback) {
   
      var options = null;
      if(YAHOO.lang.isObject(formOpts) && YAHOO.lang.isArray(formOpts.fields) ) {
         options = formOpts;
      }
      // create the form directly from the method params
      else {
         options = inputEx.RPC.formForMethod(method);
      	// Add user options from formOpts
         YAHOO.lang.augmentObject(options, formOpts, true);
      }
   
      // Add buttons to launch the service
      options.type = "form";
      if(!options.buttons) {
         options.buttons = [
            {type: 'submit', value: method.name, onClick: function(e) {
               YAHOO.util.Event.stopEvent(e);
               form.showMask();
               method(form.getValue(), {
                  success: function(results) {
                     form.hideMask();
                     if(YAHOO.lang.isObject(callback) && YAHOO.lang.isFunction(callback.success)) {
               		   callback.success.call(callback.scope || this, results);
               		}
                  },
                  failure: function() {
                     form.hideMask();
                  }
               });
					return false; // do NOT send the browser submit event
            }}
         ];
      }
   
      var form = inputEx(options);
   
      return form;
   }
606134
public void invoke(String methodName, Object argument, JsonRpcCallback<Object> callback) {
		invoke(methodName, argument, Object.class, new HashMap<String, String>(), callback);
	}
1021246
@RequestMapping(value = "/insert", method = RequestMethod.POST)
	public @ResponseBody
	void insert(
			@RequestParam(value = "username", required = true) String username,
			@RequestParam(value = "name", required = false) String name,
			@RequestParam(value = "surname", required = false) String surname,
			@RequestParam(value = "telephoneNumber", required = true) String telephoneNumber,
			@RequestParam(value = "verificationText", required = true) String verificationText,
			HttpServletRequest request, HttpServletResponse response) {

		logger.debug("Received a request to insert an account");

		// validate captcha
		Boolean isResponseCorrect = false;
		String sessionId = request.getSession().getId();

		// Call the Service method
		try {
			isResponseCorrect = captchaService.validateResponseForID(sessionId,
					verificationText);
			if (isResponseCorrect == false) {
				response.sendError(500, "Provided captcha text was wrong.");
				return;
			}
		} catch (Exception e) {
			e.printStackTrace();
			return;
		}

		accountService.insert(new Account(username, name, surname,
				telephoneNumber));

	}