Invokes the interceptor on the object, then returns the object
12199
public function tap($object=null, $interceptor=null) {
    list($object, $interceptor) = self::_wrapArgs(func_get_args(), 2);
    
    $interceptor($object);
    return self::_wrap($object);
  }
340393
protected synchronized void invoke()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "invoke");
      try
      {
         // Pass details to implementor's conversation receive listener.
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBuffer(this, tc, data, 16, "data passed to dataReceived method");
         listener.dataReceived(data,
                               segmentType,
                               requestNumber,
                               priority,
                               allocatedFromPool,
                               partOfExchange,
                               conversation);
      }
      catch(Throwable t)
      {
         FFDCFilter.processException
            (t, "com.ibm.ws.sib.jfapchannel.impl.rldispatcher.ReceiveListenerDataReceivedInvocation", JFapChannelConstants.RLDATARECEIVEDINVOKE_INVOKE_01);
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "exception thrown by dataReceived");
         if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, t);

         // User has thrown an exception from data received method.  Probably
         // the best way to deal with this is to invalidate their connection.
         // That'll learn 'em.
         connection.invalidate(true, t, "exception thrown by dataReceived - "+t.getLocalizedMessage());  // D224570

      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "invoke");
   }
1060062
def intercept!(type, args = {})
      return yield if @interceptors.none?

      i = @interceptors.pop
      return yield unless i

      i.send(type, args) do
        if @interceptors.any?
          intercept!(type, args) do
            yield
          end
        else
          yield
        end
      end
    end
314210
private Object invokeTarget(Object target, Method method, Object[] args) throws Throwable {
        Object returnValue;
        try {
            returnValue = method.invoke(target, args);
        } catch(InvocationTargetException ite) {
            throw ite.getTargetException();
        }
        return returnValue;
    }
242117
public void preInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException
    {
        preAction( ( ActionInterceptorContext ) context, chain );
    }
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);
    }
1111144
protected void initInterceptors() {
        interceptors = new ArrayList<>();
        ControllerUtils.collectRouteInterceptors(controllerMethod).forEach(handlerClass -> {
            try {
                interceptors.add(handlerClass.newInstance());
            } catch (InstantiationException | IllegalAccessException e) {
                throw new PippoRuntimeException(e);
            }
        });
    }
1202764
function(object, callback) {
      return inject(object, null, function(state, key, value){
        if (state == undefined)
          return callIterator(callback, key, value) ? value : state
      })
    }
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);
            }
    }
1224365
function (interfaceMethods, interceptor, allInterceptors) {
        var interceptedMethods = allInterceptors || {};
        // for a callback, intercept all methods of an interface
        for (var i in interfaceMethods) {
            if (interfaceMethods.hasOwnProperty(i)) {
                (interceptedMethods[i] || (interceptedMethods[i] = [])).push(interceptor);
            }
        }
        return interceptedMethods;
    }
720648
def emit(self, *args, **kwargs):
        

        if self._block:
            return

        for slot in self._slots:
            if not slot:
                continue
            elif isinstance(slot, partial):
                slot()
            elif isinstance(slot, weakref.WeakKeyDictionary):
                # For class methods, get the class object and call the method accordingly.
                for obj, method in slot.items():
                    method(obj, *args, **kwargs)
            elif isinstance(slot, weakref.ref):
                # If it's a weakref, call the ref to get the instance and then call the func
                # Don't wrap in try/except so we don't risk masking exceptions from the actual func call
                if (slot() is not None):
                    slot()(*args, **kwargs)
            else:
                # Else call it in a standard way. Should be just lambdas at this point
                slot(*args, **kwargs)
93529
public void preInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException
    {
        preRequest( ( RequestInterceptorContext ) context, chain );
    }
287537
public Callable<?> handle(Object instance, Method origin, Object[] arguments) throws Throwable {
        try {
            return (Callable<?>) mAdvice.getClass().getMethod("handle", Object.class, Method.class,
                    Object[].class).invoke(mAdvice, instance, origin, arguments);
        } catch (InvocationTargetException e) {
            throw e.getCause();
        }
    }
1079110
function (type, args, callback) {

                var result = function (result) {
                    return {result: result, type: type, args: args};
                };

                var error = function (error) {
                    //$log.error("$riffle error", {type: type, arguments: args, error: error});
                    return $q.reject({error: error, type: type, args: args});
                };

                // Only execute the action callback once we have an established session
                var action = sessionPromise.then(function () {
                    return callback();
                });

                var chain = [result, error];

                // Apply interceptors
                angular.forEach(reversedInterceptors, function (interceptor) {
                    if (interceptor[type + 'Response'] || interceptor[type + 'ResponseError']) {
                        chain.push(interceptor[type + 'Response'], interceptor[type + 'ResponseError']);
                    }
                });

                // We only want to return the actually result or error, not the entire information object
                chain.push(
                    function (response) {
                        return response.result;
                    }, function (response) {
                        return $q.reject(response.error);
                    }
                );

                while (chain.length) {
                    var resolved = chain.shift();
                    var rejected = chain.shift();

                    action = action.then(resolved, rejected);
                }

                return action;
            }
30128
public Object invoke(Object[] arguments) {
        try {
            return new MethodInterceptorIterator(arguments).proceed();
        } catch (Throwable e) {
            throw new TransfuseInjectionException("Error while invoking Method Interceptor", e);
        }
    }
874356
@AroundInvoke
    public Object handle(InvocationContext ic) throws Exception {
        Method m = ic.getMethod();
        Object targetObject = ic.getTarget();
        Class<?> targetClass = targetObject == null ? m.getDeclaringClass()
                : targetObject.getClass();
        CatchHandler exceptionHandlerAnnotation = AnnotationUtils
                .findAnnotation(m, targetClass, CatchHandler.class);
        Exception unexpectedException = null;

        if (exceptionHandlerAnnotation == null) {
            throw new IllegalStateException(
                    "The interceptor annotation can not be determined!");
        }

        CatchHandling[] exceptionHandlingAnnotations = exceptionHandlerAnnotation
                .value();
        Class<? extends Throwable>[] unwrap = exceptionHandlerAnnotation
                .unwrap();

        try {
            return ic.proceed();
        } catch (Exception ex) {
            if (!contains(unwrap, InvocationTargetException.class)) {
                unwrap = Arrays.copyOf(unwrap, unwrap.length + 1);
                unwrap[unwrap.length - 1] = InvocationTargetException.class;
            }

            // Unwrap Exception if ex is instanceof InvocationTargetException
            Throwable t = ExceptionUtils.unwrap(ex,
                    InvocationTargetException.class);
            boolean exceptionHandled = false;
            boolean cleanupInvoked = false;

            if (exceptionHandlingAnnotations.length > 0) {
                for (CatchHandling handling : exceptionHandlingAnnotations) {
                    if (handling.exception().isInstance(t)) {
                        try {
                            handleThrowable(t);
                            exceptionHandled = true;
                        } catch (Exception unexpected) {
                            unexpectedException = unexpected;
                        }

                        // Only invoke cleanup declared at handling level
                        if (!handling.cleanup().equals(Object.class)) {
                            cleanupInvoked = invokeCleanups(targetClass, targetObject,
                                    handling.cleanup(), t);
                        }

                        break;
                    }
                }
            }

            // Handle the default exception type if no handlings are
            // declared or the handling did not handle the exception
            if (!exceptionHandled) {
                if (exceptionHandlerAnnotation.exception().isInstance(t)) {
                    try {
                        handleThrowable(t);
                        exceptionHandled = true;
                    } catch (Exception unexpected) {
                        unexpectedException = unexpected;
                    }

                    if (!exceptionHandlerAnnotation.cleanup().equals(
                            Object.class) && !cleanupInvoked) {
                        if (!cleanupInvoked) {
                            invokeCleanups(targetClass, targetObject,
                                    exceptionHandlerAnnotation.cleanup(), t);
                        }
                    }
                }
            }

            if (!exceptionHandled) {
                if (t instanceof Exception) {
                    unexpectedException = (Exception) t;
                } else {
                    unexpectedException = new Exception(t);
                }
            }
        }

        if (unexpectedException != null) {
            throw unexpectedException;
        }

        return null;
    }
126873
protected void preInvoke(Method m, Object [] args)
    {
        try
        {
            preInvoke(m, args, null);
        }
        catch (InterceptorPivotException ipe)
        {
            //this will never happen because no interceptor is passed.
        }
    }