Around invoke method that measures the split for one method invocation.

@param context invocation context
@return return value from the invocation
@throws Exception exception thrown from the invocation
428750
@AroundInvoke
	public Object monitor(InvocationContext context) throws Exception {
		if (isMonitored(context)) {
			String simonName = getSimonName(context);
			try (Split ignored = SimonManager.getStopwatch(simonName).start()) {
				return context.proceed();
			}
		} else {
			return context.proceed();
		}
	}
150002
@Override
    public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
        if (SplitlogLoggerFactory.isLoggingEnabled()) {
            SplitlogLoggerFactory.increaseMessageCounter();
            return method.invoke(this.proxied, args);
        } else {
            // logging is not enabled, don't proxy the call
            return null;
        }
    }
705445
public final Object invoke(MethodInvocation invocation) throws Throwable {
		final Split split = stopwatchSource.start(invocation);
		try {
			return processInvoke(invocation, split);
		} finally {
			split.stop();
		}
	}
307516
@SuppressWarnings("unchecked")
    protected static List<String> invokeAndGetList(String methodName, Object mojo) throws Exception {
        return (List<String>) invokeGetMethod(methodName, mojo);
    }
1194978
public <X> X invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
        final Map<Class<?>, Method> methods = this.methods;
        Method method = methods.get(instance.getClass());
        if (method == null) {
            // the same method may be written to the map twice, but that is ok
            // lookupMethod is very slow
            Method delegate = annotatedMethod.getJavaMember();
            method = SecurityActions.lookupMethod(instance.getClass(), delegate.getName(), delegate.getParameterTypes());
            SecurityActions.ensureAccessible(method);
            synchronized (this) {
                final Map<Class<?>, Method> newMethods = new HashMap<Class<?>, Method>(methods);
                newMethods.put(instance.getClass(), method);
                this.methods = WeldCollections.immutableMapView(newMethods);
            }
        }
        return cast(method.invoke(instance, parameters));
    }
779518
public static RuntimeException convertReflectionExceptionToUnchecked(Exception e) {
		if ((e instanceof IllegalAccessException) || (e instanceof NoSuchMethodException)) {
			return new IllegalArgumentException(e);
		} else if (e instanceof InvocationTargetException) {
			return new RuntimeException(((InvocationTargetException) e).getTargetException());
		} else if (e instanceof RuntimeException) {
			return (RuntimeException) e;
		}
		return new UncheckedException(e);
	}
911911
@Override
    public Object proceed() throws Exception {
        Object returnValue = null;
        try {
            if (ivNextIndex < ivNumberOfInterceptors) {
                // There is atleast 1 more interceptor method in the
                // chain to invoke. Determine if method signature is
                // one that is passed the InvocationContext.
                InterceptorProxy w = ivInterceptorProxies[ivNextIndex];
                if (w.ivRequiresInvocationContext) {
                    // Method signature is <METHOD>(InvocationContext).
                    // Therefore, only call this method it will call
                    // InvocationContext.proceed() to continue with
                    // the next method in the chain.
                    ++ivNextIndex;
                    returnValue = w.invokeInterceptor(ivBean, this, ivInterceptors);
                } else {
                    // Method signature is <METHOD>(), which means it must be
                    // a lifecycle callback method of the bean class or
                    // one of its superclasses.  As required by EJB 3 spec,
                    // call all remaining lifecycle methods in the chain.
                    while (w != null) {
                        ++ivNextIndex;
                        returnValue = w.invokeInterceptor(ivBean, this, ivInterceptors);
                        w = (ivNextIndex < ivNumberOfInterceptors) ? ivInterceptorProxies[ivNextIndex] : null;
                    }
                }
            } else if (ivMethod != null) {
                // The last around invoke in the chain has called proceed,
                // so now we must invoke the business method.
                returnValue = ivContainer.invokeProceed(ivEJSDeployedSupport, ivMethod, ivBean, ivParameters, ivParametersModified); //LIDB3294-41
            } else if (ivIsAroundConstruct) {
                try {
                    ivBean = ivConstructCallback.proceed(ivParameters, getContextData());
                } catch (Exception ex) {
                    ivAroundConstructException = ex;
                    throw ex;
                }
                return null;
            }

        } catch (UndeclaredThrowableException ude) {
            throwUndeclaredExceptionCause(ude);
        } catch (InvocationTargetException ite) {
            throwUndeclaredExceptionCause(ite);
        }

        // Per the interceptor 1.2 spec, "If a lifecycle callback interceptor
        // method returns a value, it is ignored by the container."
        return ivMethod == null ? null : returnValue;
    }
719314
protected String getMonitorName(InvocationContext context) {
		String className = context.getMethod().getDeclaringClass().getSimpleName();
		String methodName = context.getMethod().getName();
		return prefix + Manager.HIERARCHY_DELIMITER + className + Manager.HIERARCHY_DELIMITER + methodName;
	}
25100
@Pure
	public static Object getContext() throws AndroidException {
		final Object ctx;
		synchronized (Android.class) {
			if (context == null) {
				throw new AndroidException();
			}
			ctx = context.get();
		}
		if (ctx == null) {
			throw new AndroidException();
		}
		return ctx;
	}
1250308
public <T> T executeInApplicationContext(Callable<T> callable) throws Exception {
        ApplicationContext context = (ApplicationContext) getScopedContext(ApplicationScoped.class);
        boolean activatedByUs = false;
        try {
            if (!context.isActive()) {
                context.activate();
                activatedByUs = true;
            }
            return callable.call();
        } finally {
            if (activatedByUs && context.isActive()) {
                context.deactivate();
            }
        }
    }
62764
public <V> V call(Callable<V> callable) throws Exception {
		initStartTotal();
		long startInvokation = System.currentTimeMillis();
		V result = callable.call();
		invoked(System.currentTimeMillis() - startInvokation);
		return result;
	}
598255
protected Integer invokeSection()
    {
        try
        {
            // run object is a JavaProcessRunner
            S runner = getRunner(getRunObject());

            if (run_method_str == null)
                return null;

            createRunMethod(param_types, runner);

            Object[] local_params = (Object[])params.clone();

            Integer result_code = (Integer) run_method.invoke(runner, local_params);

            return result_code;
        }
        // Allow ProcessImpl exceptions to be rethrown
        catch (ForceProcessComplete fpc)
        {
            throw fpc;
        }
        catch (ForceRescheduleException fre)
        {
            throw fre;
        }
        catch (InvocationTargetException ite)
        {
            Throwable cause = ite.getCause();
            if (cause instanceof ForceProcessComplete|| cause instanceof ForceRescheduleException)
                throw (RuntimeException)cause;

            new QueujException(ite);
            return BatchProcessServer.FAILURE;
        }
        catch (Exception e)
        {
            new QueujException(e);
            return BatchProcessServer.FAILURE;
        }
    }
1039038
RuleReturnScope invoke(Parser parser) throws Exception
    {
        assert parser != null;

        return (RuleReturnScope)method.invoke(parser, arguments);
    }
111123
@Override
	protected Object invoke(DelegatingMethodInvocation<T> methodInvocation) throws Throwable {
		final Split split = stopwatchSource.start(methodInvocation);
		try {
			return methodInvocation.proceed();
		} finally {
			split.stop();
		}
	}
883145
@Override
	public void invoke() throws Exception {

		if (LOG.isDebugEnabled()) {
			LOG.debug(formatLogString("Start task code."));
		}

		// whatever happens in this scope, make sure that the local strategies are cleaned up!
		// note that the initialization of the local strategies is in the try-finally block as well,
		// so that the thread that creates them catches its own errors that may happen in that process.
		// this is especially important, since there may be asynchronous closes (such as through canceling).
		try {
			// initialize the serializers (one per channel) of the record writers
			initOutputWriters(this.eventualOutputs);

			// initialize the remaining data structures on the input and trigger the local processing
			// the local processing includes building the dams / caches
			try {
				int numInputs = driver.getNumberOfInputs();
				int numBroadcastInputs = this.config.getNumBroadcastInputs();
				
				initInputsSerializersAndComparators(numInputs);
				initBroadcastInputsSerializers(numBroadcastInputs);
				
				// set the iterative status for inputs and broadcast inputs
				{
					List<Integer> iterativeInputs = new ArrayList<Integer>();
					
					for (int i = 0; i < numInputs; i++) {
						final int numberOfEventsUntilInterrupt = getTaskConfig().getNumberOfEventsUntilInterruptInIterativeGate(i);
			
						if (numberOfEventsUntilInterrupt < 0) {
							throw new IllegalArgumentException();
						}
						else if (numberOfEventsUntilInterrupt > 0) {
							this.inputReaders[i].setIterative(numberOfEventsUntilInterrupt);
							iterativeInputs.add(i);
				
							if (LOG.isDebugEnabled()) {
								LOG.debug(formatLogString("Input [" + i + "] reads in supersteps with [" +
										+ numberOfEventsUntilInterrupt + "] event(s) till next superstep."));
							}
						}
					}
					this.iterativeInputs = asArray(iterativeInputs);
				}
				
				{
					List<Integer> iterativeBcInputs = new ArrayList<Integer>();
					
					for (int i = 0; i < numBroadcastInputs; i++) {
						final int numberOfEventsUntilInterrupt = getTaskConfig().getNumberOfEventsUntilInterruptInIterativeBroadcastGate(i);
						
						if (numberOfEventsUntilInterrupt < 0) {
							throw new IllegalArgumentException();
						}
						else if (numberOfEventsUntilInterrupt > 0) {
							this.broadcastInputReaders[i].setIterative(numberOfEventsUntilInterrupt);
							iterativeBcInputs.add(i);
				
							if (LOG.isDebugEnabled()) {
								LOG.debug(formatLogString("Broadcast input [" + i + "] reads in supersteps with [" +
										+ numberOfEventsUntilInterrupt + "] event(s) till next superstep."));
							}
						}
					}
					this.iterativeBroadcastInputs = asArray(iterativeBcInputs);
				}
				
				initLocalStrategies(numInputs);
			} catch (Exception e) {
				throw new RuntimeException("Initializing the input processing failed" +
					e.getMessage() == null ? "." : ": " + e.getMessage(), e);
			}

			if (!this.running) {
				if (LOG.isDebugEnabled()) {
					LOG.debug(formatLogString("Task cancelled before task code was started."));
				}
				return;
			}

			// pre main-function initialization
			initialize();

			// read the broadcast variables
			for (int i = 0; i < this.config.getNumBroadcastInputs(); i++) {
				final String name = this.config.getBroadcastInputName(i);
				readAndSetBroadcastInput(i, name, this.runtimeUdfContext);
			}

			// the work goes here
			run();
		}
		finally {
			// clean up in any case!
			closeLocalStrategiesAndCaches();
		}

		if (this.running) {
			if (LOG.isDebugEnabled()) {
				LOG.debug(formatLogString("Finished task code."));
			}
		} else {
			if (LOG.isDebugEnabled()) {
				LOG.debug(formatLogString("Task code cancelled."));
			}
		}
	}
1197589
public long total(ByteBuffer context)
    {
        long total = 0L;
        // we could use a ContextState but it is easy enough that we avoid the object creation
        for (int offset = context.position() + headerLength(context); offset < context.limit(); offset += STEP_LENGTH)
            total += context.getLong(offset + CounterId.LENGTH + CLOCK_LENGTH);
        return total;
    }
177167
@Override
    public void parse(ParseContext context)
            throws MonetaryParseException {
        if (!context.consume(token)) {
            throw new MonetaryParseException(context.getOriginalInput(),
                    context.getErrorIndex());
        }
    }