Bind interceptor early
550349
public function bindPriorityInterceptor(AbstractMatcher $classMatcher, AbstractMatcher $methodMatcher, array $interceptors)
    {
        $pointcut = new PriorityPointcut($classMatcher, $methodMatcher, $interceptors);
        $this->container->addPointcut($pointcut);
        foreach ($interceptors as $interceptor) {
            (new Bind($this->container, $interceptor))->to($interceptor)->in(Scope::SINGLETON);
        }
    }
406399
@Skip
    @Override
    public void bind(ChannelHandlerContext ctx, SocketAddress localAddress,
                     ChannelPromise promise) throws Exception {
        ctx.bind(localAddress, promise);
    }
158486
private void updateBind(Node n) {
    CodingConvention.Bind bind =
        compiler.getCodingConvention().describeFunctionBind(n, false, true);
    if (bind == null) {
      return;
    }

    Node target = bind.target;
    FunctionType callTargetFn = getJSType(target)
        .restrictByNotNullOrUndefined().toMaybeFunctionType();
    if (callTargetFn == null) {
      return;
    }

    if (bind.thisValue != null && target.isFunction()) {
      JSType thisType = getJSType(bind.thisValue);
      if (thisType.toObjectType() != null && !thisType.isUnknownType()
          && callTargetFn.getTypeOfThis().isUnknownType()) {
        callTargetFn =
            FunctionType.builder(registry)
                .copyFromOtherFunction(callTargetFn)
                .withTypeOfThis(thisType.toObjectType())
                .build();
        target.setJSType(callTargetFn);
      }
    }

    n.setJSType(
        callTargetFn.getBindReturnType(
            // getBindReturnType expects the 'this' argument to be included.
            bind.getBoundParameterCount() + 1));
  }
602793
def handle_interceptors(args):
    
    assert args
    print('\n'.join(cosmic_ray.plugins.interceptor_names()))

    return ExitCode.OK
639920
function iterate(self, interceptors, args, after) {
      if (!interceptors || !interceptors.length) {
        after.apply(self, args);
        return;
      }

      var i = 0;
      var len = interceptors.length;
      if (!len) {
        after.apply(self, args);
        return;
      }

      function nextInterceptor() {
        if (i === len) {
          i++;
          after.apply(self, arguments);
        }
        else if (i < len) {
          var used = false;
          var interceptor = interceptors[i++];
          interceptor.apply(self, Array.prototype.slice.call(arguments, 1).concat(function next(err) {
            //
            // Do not allow multiple continuations
            //
            if (used) { return; }

            used = true;
            if (!err || !callback) {
              nextInterceptor.apply(null, waterfall ? arguments : args);
            } else {
              after.call(self, err);
            }
          }));
        }
      }
      nextInterceptor.apply(null, args);
    }
1177116
public void initConstructorDeclaredEjbInterceptors() {
        Class<?>[] constructorDeclaredInterceptors = interceptorsApi.extractInterceptorClasses(constructor);
        if (constructorDeclaredInterceptors != null) {
            for (Class<?> clazz : constructorDeclaredInterceptors) {
                builder.interceptGlobal(InterceptionType.AROUND_CONSTRUCT, null, Collections.<InterceptorClassMetadata<?>>singleton(reader.getPlainInterceptorMetadata(clazz)), null);
            }
        }
    }
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);
            }
        });
    }
42905
protected function bindDefaultTriggers()
    {
        $this->handlers[self::EVENT_INIT]   = $this->fluentCallback([$this, 'handleInit']);
        $this->handlers[self::EVENT_FORK]   = $this->fluentCallback([$this, 'handleFork']);
        $this->handlers[self::EVENT_START]  = $this->fluentCallback([$this, 'handleStart']);
    }
1366074
function injectBefore(replServer, method, beforeFn) {
  var _orig = replServer[method];
  replServer[method] = function() {
    var args = Array.prototype.slice.call(arguments);
    var callback = args.pop();
    beforeFn.apply(null, args.concat(function(err, res) {
      if (err || res) {
        callback(err, res);
      } else {
        _orig.apply(replServer, args.concat(callback));
      }
    }));
  };
  return replServer;
}
683874
@Override
    protected void configure() {

        install(new com.englishtown.promises.hk2.WhenBinder());

        bind(VertxExecutor.class).to(Executor.class).in(Singleton.class).ranked(10);

        bind(DefaultWhenVertx.class).to(WhenVertx.class).in(Singleton.class);
        bind(DefaultWhenEventBus.class).to(WhenEventBus.class).in(Singleton.class);
        bind(DefaultWhenHttpClient.class).to(WhenHttpClient.class).in(Singleton.class);
        bind(DefaultWhenFileSystem.class).to(WhenFileSystem.class).in(Singleton.class);
        bind(DefaultPromiseAdapter.class).to(PromiseAdapter.class).in(Singleton.class);

    }
1138819
@Override
    protected void configure() {

        install(Modules.override(new WhenBinder()).with(new OverridesGuiceWhenBinder()));

        bind(WhenVertx.class).to(DefaultWhenVertx.class).in(Singleton.class);
        bind(WhenEventBus.class).to(DefaultWhenEventBus.class).in(Singleton.class);
        bind(WhenHttpClient.class).to(DefaultWhenHttpClient.class).in(Singleton.class);
        bind(WhenFileSystem.class).to(DefaultWhenFileSystem.class).in(Singleton.class);
        bind(PromiseAdapter.class).to(DefaultPromiseAdapter.class).in(Singleton.class);

    }
1093805
def init(*args, **kwargs):
    
    global _initial_client
    client = Client(*args, **kwargs)
    Hub.current.bind_client(client)
    rv = _InitGuard(client)
    if client is not None:
        _initial_client = weakref.ref(client)
    return rv
280497
def insert(cls, index, interceptor):
        
        cls._check(interceptor)
        cls._interceptors.insert(index, interceptor)
8754
function interceptPropertyGet(_ref7) {
  var _this2 = this;

  var entity = _ref7.entity,
      properties = _ref7.properties;

  // Create a proxy .interceptPropertyGet(...) methods, per property
  this.interceptPropertyGet = _lodash2.default.reduce(properties, function (interceptPropertyGet, propertyConfiguration, propertyName) {

    // Fetch extensions implementing .interceptPropertyGet(...) method for this property's interceptor functions
    var getterInterceptors = _lodash2.default.compact(_lodash2.default.map(_this2.extensions, function (extension) {
      // Check if implementing .interceptPropertyGet(...) method
      if (extension.implemented.interceptPropertyGet) {
        // Return the setter interceptor function (if returned for this property)
        return extension.interceptPropertyGet(propertyName, propertyConfiguration);
      }
    }));

    // Initialize a per-property setter intercepting function and returns the updated value
    interceptPropertyGet[propertyName] = function (currentValue, newValue) {

      // Initialize the EnTTExtValueEvent event
      var changes = [currentValue, newValue],
          event = new _enttext.EnTTExtValueEvent({
        changes: changes,
        currentValue: currentValue,
        value: newValue
      });

      // Cycle through all the setter interceptors
      _lodash2.default.forEach(getterInterceptors, function (getterInterceptor) {
        // Execute the extensino intercaptor
        getterInterceptor(entity, properties, event);
        // Update the changes array for the next interceptor
        changes.push(event.value);
      });

      // Return the updated value
      return event.value;
    };

    // Return composed interceptors
    return interceptPropertyGet;
  }, {});
}
497187
function setBeforeRouteChangeHandler(handler) {
            if (null == handler) {
                return _beforeRouteChange;
            }
            else {
                var oldHandler = _beforeRouteChange;
                _beforeRouteChange = handler;
                return oldHandler;
            }
        }
1371073
function bind() {
    $.each(actions, function(key, value) {
        $.each(value.eventHandle, function(index, hb) {
            hb.elem.live(hb.event, function(e) {
                var isSend = false;
                if (hb.handle) {
                    isSend = hb.handle(e);
                } else {
                    isSend = true;
                }
                if (isSend) {
                    if (value.before) {
                        value.before($(e.target));
                    }
                    send(value);
                }
            });
        });
    });
    initPjax();
}
138351
function(name, handler, context){
      var config = {
        callback: handler,
        context: context
      };

      this._wreqrHandlers[name] = config;

      this.trigger("handler:add", name, handler, context);
    }