/* (non-Javadoc)
@see minium.web.internal.drivers.Foo#invoke(org.openqa.selenium.JavascriptExecutor, java.lang.String, java.lang.Object)
342883
@Override
    public <T> T invoke(JavascriptExecutor wd, String expression, Object... args) {
        return this.<T> doInvoke(wd, expression, args);
    }
606134
public void invoke(String methodName, Object argument, JsonRpcCallback<Object> callback) {
		invoke(methodName, argument, Object.class, new HashMap<String, String>(), callback);
	}
369312
@Override
    public Object invoke(Object[] allVals) throws InvocationTargetException {
        Object[] vals;
        Object tmp;

        vals = new Object[paraParaCount];
        System.arraycopy(allVals, idx, vals, 0, vals.length);
        tmp = para.invoke(vals);

        vals = new Object[baseParaCount];
        System.arraycopy(allVals, 0, vals, 0, idx);
        vals[idx] = tmp;
        System.arraycopy(allVals, idx + paraParaCount, vals, idx + 1, vals.length - (idx + 1));

        return base.invoke(vals);
    }
557323
@Override
    public void invoke(String method, IPendingServiceCallback callback) {
        log.debug("invoke method: {} params {} callback {}", new Object[] { method, callback });
        // get it from the conn manager
        if (conn != null) {
            conn.invoke(method, callback);
        } else {
            log.info("Connection was null");
            PendingCall result = new PendingCall(method);
            result.setStatus(Call.STATUS_NOT_CONNECTED);
            callback.resultReceived(result);
        }
    }
1078424
public static <T> void invoke(List<QueryExprMeta> queries,
                                  QueryExprInvoker<T> invoker,
                                  ExprApplier<T> exprApplier) {
        for (QueryExprMeta expr : queries) {
            exprApplier.apply(invoker.invoke(expr));
        }
    }
1144504
@Override
    public Object invoke(Object[] vals) throws InvocationTargetException {
        Object[] tmp;
        int i;

        try {
            if (isStatic()) {
                return meth.invoke(null, vals);
            } else {
                if (vals.length == 0) {
                    throw new IllegalArgumentException("invalid arguments");
                }

                tmp = new Object[vals.length - 1];
                for (i = 1; i < vals.length; i++) {
                    tmp[i-1] = vals[i];
                }

                return meth.invoke(vals[0], tmp);
            }
        } catch (InvocationTargetException | IllegalArgumentException e) {
            throw e;
        } catch (IllegalAccessException e) {
            // isValid should prevent this
            throw new RuntimeException("can't access method");
        }
    }
899227
@Override
	public void invoke(IN next, Context context) throws Exception {
		// propagate asynchronous errors
		checkErroneous();

		byte[] serializedKey = schema.serializeKey(next);
		byte[] serializedValue = schema.serializeValue(next);
		String targetTopic = schema.getTargetTopic(next);
		if (targetTopic == null) {
			targetTopic = defaultTopicId;
		}

		int[] partitions = this.topicPartitionsMap.get(targetTopic);
		if (null == partitions) {
			partitions = getPartitionsByTopic(targetTopic, producer);
			this.topicPartitionsMap.put(targetTopic, partitions);
		}

		ProducerRecord<byte[], byte[]> record;
		if (flinkKafkaPartitioner == null) {
			record = new ProducerRecord<>(targetTopic, serializedKey, serializedValue);
		} else {
			record = new ProducerRecord<>(
					targetTopic,
					flinkKafkaPartitioner.partition(next, serializedKey, serializedValue, targetTopic, partitions),
					serializedKey,
					serializedValue);
		}
		if (flushOnCheckpoint) {
			synchronized (pendingRecordsLock) {
				pendingRecords++;
			}
		}
		producer.send(record, callback);
	}
1267855
private <Output, Input> Response<Output> invoke(Request<Input> request,
                                                    RequestConfig requestConfig,
                                                    ExecutionContext executionContext,
                                                    HttpResponseHandler<Output> responseHandler,
                                                    HttpResponseHandler<? extends SdkBaseException> errorResponseHandler) {

        executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(
                requestConfig, awsCredentialsProvider));

        return doInvoke(request, requestConfig, executionContext, responseHandler,
                        errorResponseHandler);
    }
389490
public Object invokeFunction(String name, Object... args)
    throws ScriptException, NoSuchMethodException {
        return invoke(null, name, args);
    }
128517
function invoke(id) {
  this.isPending[id] = true;
  this.callbacks[id](this.pendingPayload);
  this.isHandled[id] = true;
}
147647
private Object invoke(String methodName, Object returnValueIfNonExistent,
                          Class<?>[] paramTypes, Object[] params)
        throws DocletInvokeException {
            Method meth;
            try {
                meth = docletClass.getMethod(methodName, paramTypes);
            } catch (NoSuchMethodException exc) {
                if (returnValueIfNonExistent == null) {
                    messager.error(Messager.NOPOS, "main.doclet_method_not_found",
                                   docletClassName, methodName);
                    throw new DocletInvokeException();
                } else {
                    return returnValueIfNonExistent;
                }
            } catch (SecurityException exc) {
                messager.error(Messager.NOPOS, "main.doclet_method_not_accessible",
                               docletClassName, methodName);
                throw new DocletInvokeException();
            }
            if (!Modifier.isStatic(meth.getModifiers())) {
                messager.error(Messager.NOPOS, "main.doclet_method_must_be_static",
                               docletClassName, methodName);
                throw new DocletInvokeException();
            }
            ClassLoader savedCCL =
                Thread.currentThread().getContextClassLoader();
            try {
                if (appClassLoader != null) // will be null if doclet class provided via API
                    Thread.currentThread().setContextClassLoader(appClassLoader);
                return meth.invoke(null , params);
            } catch (IllegalArgumentException exc) {
                messager.error(Messager.NOPOS, "main.internal_error_exception_thrown",
                               docletClassName, methodName, exc.toString());
                throw new DocletInvokeException();
            } catch (IllegalAccessException exc) {
                messager.error(Messager.NOPOS, "main.doclet_method_not_accessible",
                               docletClassName, methodName);
                throw new DocletInvokeException();
            } catch (NullPointerException exc) {
                messager.error(Messager.NOPOS, "main.internal_error_exception_thrown",
                               docletClassName, methodName, exc.toString());
                throw new DocletInvokeException();
            } catch (InvocationTargetException exc) {
                Throwable err = exc.getTargetException();
                if (apiMode)
                    throw new ClientCodeException(err);
                if (err instanceof java.lang.OutOfMemoryError) {
                    messager.error(Messager.NOPOS, "main.out.of.memory");
                } else {
                    messager.error(Messager.NOPOS, "main.exception_thrown",
                               docletClassName, methodName, exc.toString());
                    exc.getTargetException().printStackTrace();
                }
                throw new DocletInvokeException();
            } finally {
                Thread.currentThread().setContextClassLoader(savedCCL);
            }
    }
1336969
public void invoke(AbstractHessianInput in, AbstractHessianOutput out)
        throws Exception
    {
        invoke(_service, in, out);
    }
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);
    }
536909
final synchronized void invoke() {
        result = null;
        exception = null;
        try {
            result = call();
        } catch( Throwable e ) {
            exception = e;
        } finally {
        	done = true;
        }

        // let the calling thread know that we are done.
        notify();
    }
113974
public Object invoke(FacesContext context, Object[] params)
            throws EvaluationException, MethodNotFoundException
    {
        try
        {
            return m.invoke(context.getELContext(), params);
        }
        catch (javax.el.MethodNotFoundException e)
        {
            throw new MethodNotFoundException(e.getMessage(), e.getCause());
        }
        catch (ELException e)
        {
            throw new EvaluationException(e.getMessage(), e.getCause());
        }
    }
713286
@Override
    public final synchronized Object preInvoke(EJSDeployedSupport s,
                                               ContainerTx tx) // d139352-2
                    throws RemoteException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "preInvoke: " + this);

        switch (state) {
            case METHOD_READY:
                // For BMStatefulBeanO - pre Java EE 1.3 only
                setState(IN_METHOD);
                break;

            case TX_METHOD_READY:
                setState(TX_IN_METHOD);
                break;

            default:
                throw new InvalidBeanOStateException(StateStrs[state], "METHOD_READY | TX_METHOD_READY");
        }

        //------------------------------------------------------------
        // Set isolation level to that associated with method
        // being invoked on this instance, and save current isolation
        // level so it may be restored in postInvoke.
        //------------------------------------------------------------

        int tmp = currentIsolationLevel;
        currentIsolationLevel = s.currentIsolationLevel;
        s.currentIsolationLevel = tmp;

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "preInvoke: " + getStateName(state));

        return ivEjbInstance;
    }
313187
@Override
	public void eval(String javascript) throws WidgetException {
		WebElement element = findElement(false);
		WebDriver wd = getGUIDriver().getWrappedDriver();
		try {
			((JavascriptExecutor) wd).executeScript(javascript, element);
		} catch (Exception e) {
			long time = System.currentTimeMillis() + 2000;
			boolean success = false;
			while (!success && System.currentTimeMillis() < time) {
				try {
					((JavascriptExecutor) wd).executeScript(javascript, element);
					success = true;
				} catch (Exception e2) {
					try {
						Thread.sleep(500);
					} catch (InterruptedException e1) {
						// Ignore
					}
					e = e2;
				}
			}

			if (!success) {
				throw new RuntimeException(e);
			}
		}
	}