Asynchronously call the specified method on a DBus proxy object.
546487
async def proxy_new_for_bus(bus_type, flags, info, name, object_path,
                            interface_name):
    """"""
    future = Future()
    cancellable = None
    Gio.DBusProxy.new_for_bus(
        bus_type,
        flags,
        info,
        name,
        object_path,
        interface_name,
        cancellable,
        gio_callback,
        future,
    )
    result = await future
    value = Gio.DBusProxy.new_for_bus_finish(result)
    if value is None:
        raise RuntimeError("Failed to connect DBus object!")
    return value
577051
public void executeAsyncTimed(final long timeout) {
		if (executeThread != null) {
			throw new IllegalStateException("use executable once per call");
		}
		final Executable nestedExec = this;
		helperExecutable = new Executable() {
			public Object execute() throws Throwable {
				return nestedExec.executeTimed(timeout);
			}
		};
		helperExecutable.executeAsync();
	}
393890
public Object invoke (Object proxy, Method method, Object[] args) throws Throwable {
        if (isCorrectMethod(method, args)) {
            boolean handled = callTarget(args[0]);
            setApplicationEventHandled(args[0], handled);
        }
        // All of the ApplicationListener methods are void; return null regardless of what happens
        return null;
    }
876745
def _call(self, method_proxy, *args):
        
        request = self._gw.addRequest(method_proxy, *args)

        if self._auto_execute:
            response = self._gw.execute_single(request)

            if response.status == remoting.STATUS_ERROR:
                if hasattr(response.body, 'raiseException'):
                    try:
                        response.body.raiseException()
                    except:
                        raise
                else:
                    raise remoting.RemotingError

            return response.body

        return request
358561
async def connect_service(bus_name, object_path, interface):
    """"""
    proxy = await proxy_new_for_bus(
        Gio.BusType.SYSTEM,
        Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES |
        Gio.DBusProxyFlags.DO_NOT_CONNECT_SIGNALS,
        info=None,
        name=bus_name,
        object_path=object_path,
        interface_name=interface,
    )
    return InterfaceProxy(proxy)
124063
@Override
    protected Connection proxyConnection(Connection target, ConnectionCallback callback) {
        return new ConnectionDecorator(target, callback);
    }
355164
def method_call(receiver, message, args, pseudo_type=None):
    ''''''

    if not isinstance(receiver, Node):
        receiver = local(receiver)
    return Node('method_call', receiver=receiver, message=message, args=args, pseudo_type=pseudo_type)
1067697
def call(self, method, *args, **kw):
        
        if args and kw:
            raise ValueError("JSON-RPC method calls allow only either named or positional arguments.")
        if not method:
            raise ValueError("JSON-RPC method call requires a method name.")

        request = self._data_serializer.assemble_request(
            method, args or kw or None
        )

        if self._in_batch_mode:
            self._requests.append(request)
            return request.get('id')
        else:
            return request
654862
private void callHandleMethod(Method method, Object instance, ApiZone apiZone,
            Object userAgent) {
        ReflectMethodUtil.invokeHandleMethod(method, instance, context, apiZone, userAgent);
    }
675704
public static MethodHandleProxy proxyMethod(Object target,String methodName,Object ...args)
	{
		MethodHandle mh=findMethodHandle(target, methodName, args);
		if(mh!=null)
		{
			return new MethodHandleProxy(target, mh, args);
		}
		return null;
	}
1285506
@Override
    public <R> R callMethod(String methodName, long timeout) throws CouldNotPerformException, InterruptedException {
        return callMethod(methodName, null, timeout);
    }
1302706
def method_missing(method_name, *args, &block)
      if Array.wrap(Config.proxy_method_name).include?(method_name)
        UnitProxyProvider.class_eval do
          define_method(method_name) do |*_args|
            name = _args.first || Function.current_unit.try(:unit_name)
            if name && unit = Loader.load(name)
              UnitProxy.new(unit, self)
            end
          end
        end
        send(method_name, args.first)
      else
        super
      end
    end
251635
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy)
        throws Throwable {

        if (method.getName().equals("toString") && args.length == 0) {
            return locator.toString();
        }

        if (Object.class.equals(method.getDeclaringClass())) {
            return proxy.invokeSuper(obj, args);
        }

        if (WrapsDriver.class.isAssignableFrom(method.getDeclaringClass()) && method.getName()
            .equals("getWrappedDriver")) {
            return driver;
        }

        WebElement realElement = locator.findElement();
        return getObject(realElement, method, args);
    }
1362638
public static Object[] call(Method method, Object[][] params,
                              InetSocketAddress[] addrs,
                              UserGroupInformation ticket, Configuration conf)
    throws IOException {

    Invocation[] invocations = new Invocation[params.length];
    for (int i = 0; i < params.length; i++)
      invocations[i] = new Invocation(method, null, params[i]);
    Client client = CLIENTS.getClient(conf);
    try {
    Writable[] wrappedValues =
      client.call(invocations, addrs, method.getDeclaringClass(), ticket);

    if (method.getReturnType() == Void.TYPE) {
      return null;
    }

    Object[] values =
      (Object[])Array.newInstance(method.getReturnType(), wrappedValues.length);
    for (int i = 0; i < values.length; i++)
      if (wrappedValues[i] != null)
        values[i] = ((ObjectWritable)wrappedValues[i]).get();
    
    return values;
    } finally {
      CLIENTS.stopClient(client);
    }
  }
547259
@Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if (target == null) {
            target = JndiUtils.lookup(name);
        }
        return method.invoke(target, args);
    }
708706
@Override
    public <R, T extends Object> Future<R> callMethodAsync(final String methodName, final T argument) {

        try {
            validateMiddleware();
        } catch (InvalidStateException ex) {
            return FutureProcessor.canceledFuture(ex);
        }

        return GlobalCachedExecutorService.submit(new Callable<R>() {

            private Future<R> internalCallFuture;

            @Override
            public R call() throws Exception {

                final String shortArgument = RPCHelper.argumentToString(argument);

                try {
                    try {
                        logger.debug("Calling method async [" + methodName + "(" + shortArgument + ")] on scope: " + remoteServer.getScope().toString());

                        if (!isConnected()) {
                            try {
                                waitForConnectionState(CONNECTED, CONNECTION_TIMEOUT);
                            } catch (TimeoutException ex) {
                                throw new CouldNotPerformException("Cannot not call async method[" + methodName + "(" + shortArgument + ")] on [" + this + "] in connectionState[" + connectionState + "]", ex);

                            }
                        }
                        final long currentTime = System.nanoTime();
                        remoteServerWatchDog.waitForServiceActivation();
                        internalCallFuture = remoteServer.callAsync(methodName, argument);
                        while (true) {

                            if (TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - currentTime) > RPCHelper.RPC_TIMEOUT) {
                                throw new TimeoutException("RPCMethod call timeout");
                            }

                            try {
                                return internalCallFuture.get(REQUEST_TIMEOUT, TimeUnit.MILLISECONDS);
                            } catch (java.util.concurrent.TimeoutException ex) {


                                // validate connection
                                try {
                                    // if reconnecting do not start a ping but just wait for connecting again
                                    if (getConnectionState() != RECONNECTING) {
                                        ping().get(REQUEST_TIMEOUT, TimeUnit.MILLISECONDS);
                                    } else {
                                        waitForConnectionState(CONNECTING);
                                    }
                                } catch (ExecutionException | java.util.concurrent.TimeoutException | CancellationException exx) {
                                    // cancel call if connection is broken
                                    if (internalCallFuture != null) {
                                        internalCallFuture.cancel(true);
                                    }
                                }
                            } catch (ExecutionException ex) {
                                if (ex.getCause() instanceof RSBException) {
                                    throw new RSBResolvedException("Remote call failed!", (RSBException) ex.getCause());
                                }
                                throw ex;
                            } catch (InterruptedException ex) {
                                Thread.currentThread().interrupt();
                            }

                            // check if thread was interrupted during processing
                            if (Thread.currentThread().isInterrupted()) {
                                throw new InterruptedException();
                            }
                        }


                    } catch (final InterruptedException ex) {
                        if (internalCallFuture != null) {
                            internalCallFuture.cancel(true);
                        }
                        throw ex;
                    } catch (final InvalidStateException ex) {
                        // reinit remote service because middleware connection lost!
                        switch (connectionState) {
                            // only if the connection was established before and no reconnect is ongoing.
                            case CONNECTING:
                            case CONNECTED:
                                try {
                                    reinit();
                                } catch (final CouldNotPerformException exx) {
                                    ExceptionPrinter.printHistory("Recovering middleware connection failed!", exx, logger);
                                }
                        }
                        throw ex;
                    }
                } catch (final CouldNotPerformException | CancellationException | InterruptedException ex) {
                    throw new CouldNotPerformException("Could not call remote Method[" + methodName + "(" + shortArgument + ")] on Scope[" + remoteServer.getScope() + "].", ex);
                }
            }
        });
    }
809831
public Object call(Object object, String method, Object[] args) throws BSFException {
        return InvokerHelper.invokeMethod(object, method, args);
    }