Invoke a method on java object.

@param int    $object_id a java object or type
@param string $method    method name
@param array  $args      arguments to send with method

@return mixed
771656
public function invokeMethod(int $object_id, string $method, array $args = [])
    {
        $this->protocol->invokeBegin($object_id, $method);
        $this->writeArgs($args);

        $this->protocol->invokeEnd();
        $val = $this->getResult();

        return $val;
    }
1098376
@Override
  public Object invokeMethod(String name, Object[] args) {
    ISlot slot = findSlot(name, args);
    PojoGestalt gestalt = createGestalt(slot.getType(), args);
    new Sculpturer().$form(gestalt);
    slot.write(gestalt.getSubject());
    return gestalt.getSubject();
  }
1239523
public function callMethod (&$api, $module, $method, $args = array ())
	{
		
		// Set module class name
		
		$class		= $this->getModuleClass ($module);
		
		// Create module object
		
		$obj		= new $class;
		
		// Set the API reference
		
		$obj->api	= $api;
		
		// Call the method init function for any custom code before the action
		
		if ($obj->callInit ($this, $method, $args))
		{
			
			// Call module method and pass the arguments list as 
			
			$return	= call_user_func_array (array ($obj, $method), array ($args));
			
		}
		
		// Return result
		
		return $obj->getResult ();
		
	}
1112455
public function invoke(
        $obj,
        string $method,
        array $params = []
    ) {
        if (is_string($obj)) {
            //Attempt to retrieve object from
            //the container.
            $obj = $this->get($obj);
        } elseif (!is_object($obj)) {
            //Not a valid argument.
            throw new \Exception('Invalid object');
        }

        $map = $this->generateArgumentsMap(
            $obj,
            $method,
            $params
        );
        $mapParams = $this->getParamsFromMap($map);

        return $obj->$method(...$mapParams);
    }
898297
public static function invokePrivateMethod($object, $method, $args = [], $class = null)
    {
        if (is_null($class)) {
            $class = $object;
        }

        $method = new \ReflectionMethod($class, $method);
        $method->setAccessible(true);

        return $method->invokeArgs($object, $args);
    }
1269606
public static function getFunctionParamsFromCallMapById(Codebase $codebase, $method_id, array $args)
    {
        $function_param_options = CallMap::getParamsFromCallMap($method_id);

        if ($function_param_options === null) {
            throw new \UnexpectedValueException(
                'Not expecting $function_param_options to be null for ' . $method_id
            );
        }

        return self::getMatchingParamsFromCallMapOptions($codebase, $function_param_options, $args);
    }
922120
public function _call($instance, $method, $arguments = [])
    {
        if (method_exists($instance, $method)) {
            return call_user_func_array([$instance, $method], $arguments);
        }
    }
1200242
public static function callMethod($objectOrClass, string $methodName, ...$args)
    {
        $objectOrClass = self::getObject($objectOrClass);
        $closure =
            /**
             * @param string $methodName
             * @param array $args
             * @return mixed
             */
            function (string $methodName, ...$args) {
                if (\method_exists($this, $methodName)) {
                    return $this->$methodName(...$args);
                }
                throw new \RuntimeException(
                    Picklock::errorMessage($this, $methodName, true)
                );
            };
        return
            $closure->call($objectOrClass, $methodName, ...$args);
    }
1213496
public static Object callMethod(Object obj, String methodName, Object[] args) throws PageException {
	return callMethod(obj, KeyImpl.getInstance(methodName), args);
    }
1367621
private function call($method, array $args)
    {
        $request = $this->rpcProtocol->encodeRequest($method, $args);

        $response = $this->transport->request($request);

        $response = $this->rpcProtocol->decodeValue($response);

        if ($response instanceof \Exception) {
            throw $response;
        }

        return $response;
    }
879144
protected function callWithRelation($method, $args, $entity)
    {
        $relation = $entity->callWith($method, $args, $entity, true);

        if (!$relation && prod()) {
            return null;
        }

        if ($this instanceof Collection) {
            $relation->fillCollection($this);
        } else if ($this instanceof Record) {
            $relation->fillRecord($this);
        }

        return $relation;
    }
536046
public static function callMethod(
        string $name,
        ?object $object,
        array $arguments = [],
        ?string $classOverride = null
    ) {
        $method = self::getReflectionMethod($name, $object, $classOverride);
        $method->setAccessible(true);
        if (count($arguments) > 0) {
            return $method->invokeArgs($object, $arguments);
        }
        return $method->invoke($object);
    }
416590
public static Object invoke(Object instance, Method method, Object... args) throws IllegalAccessException, InvocationTargetException {
        if (method.isVarArgs()) {
            args = fixVarArgs(method.getParameterTypes(), args);
        }
        return method.invoke(instance, args);
    }
574676
protected function callHandler($handler_id, $method, array $arguments)
    {
        try {
            $handlers = $this->getHandlers();
            return Handler::call($handlers, $handler_id, $method, $arguments);
        } catch (Exception $ex) {
            return $ex->getMessage();
        }
    }
1039345
public function call($className, $method, $arguments = null)
    {
        $callable = [$className, $method];
        if ($arguments === null) {
            return call_user_func($callable);
        } else {
            return call_user_func_array($callable, $arguments);
        }
    }
523316
public static function invokeWithIocParams($obj, $method) {
        $method = new \ReflectionMethod(get_class($obj), $method);
        $args = [];
        if ($method->getNumberOfParameters() > 0) {
            $params = $method->getParameters();
            foreach ($params as $param) {
                $class = $param->getClass();
                if ($class) {
                    $className = $class->getName();
                    $bean = Ioc::get($className);
                    if (!$bean) {
                        $args[] = method_exists($className, 'instance') ? $className::instance() : new $className();
                    } else {
                        $args[] = $bean;
                    }
                } else {
                    $args[] = null;
                }
            }
        }
        $val = $method->invokeArgs($obj, $args);
        return $val;
    }
1128292
protected function invokeMethod(&$object, $methodName, array $parameters = [])
    {
        return $this->getMethodInstance($object, $methodName)->invokeArgs($object, $parameters);
    }