Excute interceptor

@param index    current interceptor index
@param counter  interceptor counter
@param postcard routeMeta
547154
private static void _excute(final int index, final CancelableCountDownLatch counter, final Postcard postcard) {
        if (index < Warehouse.interceptors.size()) {
            IInterceptor iInterceptor = Warehouse.interceptors.get(index);
            iInterceptor.process(postcard, new InterceptorCallback() {
                @Override
                public void onContinue(Postcard postcard) {
                    // Last interceptor excute over with no exception.
                    counter.countDown();
                    _excute(index + 1, counter, postcard);  // When counter is down, it will be execute continue ,but index bigger than interceptors size, then U know.
                }

                @Override
                public void onInterrupt(Throwable exception) {
                    // Last interceptor excute over with fatal exception.

                    postcard.setTag(null == exception ? new HandlerException("No message.") : exception.getMessage());    // save the exception message for backup.
                    counter.cancel();
                    // Be attention, maybe the thread in callback has been changed,
                    // then the catch block(L207) will be invalid.
                    // The worst is the thread changed to main thread, then the app will be crash, if you throw this exception!
//                    if (!Looper.getMainLooper().equals(Looper.myLooper())) {    // You shouldn't throw the exception if the thread is main thread.
//                        throw new HandlerException(exception.getMessage());
//                    }
                }
            });
        }
    }
349274
@Override
	public void process(Request request)
	{
		String name = getRouteName(request);

		if (name == null || name.isEmpty()) return;

		if (!ROUTE_TIMERS.containsKey(name))
		{
			ROUTE_TIMERS.putIfAbsent(name, metrics.timer(getTimerName(name)));
		}

		if (!EXCEPTION_COUNTERS_BY_ROUTE.containsKey(name))
		{
			EXCEPTION_COUNTERS_BY_ROUTE.putIfAbsent(name, metrics.counter(getExceptionCounterName(name)));
		}
	}
48853
public void postInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException
    {
        postRequest( ( RequestInterceptorContext ) context, chain );
    }
1042186
public void removeAt(int index) {
        synchronized (mLock) {
            if (mOriginalValues != null) {
                mOriginalValues.remove(index);
            } else {
                mObjects.remove(index);
            }
        }
        if (mNotifyOnChange) notifyDataSetChanged();
    }
889528
private void setCurrentAndMeta(final ByteMap<ExpressionDataPoint[]> 
      ordered_intersection) {
    for (final String id : queries.keySet()) {
      current_values.put(id, new ExpressionDataPoint[ordered_intersection.size()]);
    }
    
    int i = 0;
    for (final ExpressionDataPoint[] idps : ordered_intersection.values()) {
      for (int x = 0; x < idps.length; x++) {
        final ExpressionDataPoint[] current_dps = 
            current_values.get(index_to_names[x]);
        current_dps[i] = idps[x];
      }
      ++i;
    }
    series_size = ordered_intersection.size();
  }
956882
public void setPostMeta(final long postId, final List<Meta> postMeta) throws SQLException {

      clearPostMeta(postId);

      if(postMeta == null || postMeta.size() == 0) {
         return;
      }
      Connection conn = null;
      PreparedStatement stmt = null;
      Timer.Context ctx = metrics.setPostMetaTimer.time();
      try {
         conn = connectionSupplier.getConnection();
         stmt = conn.prepareStatement(insertPostMetaSQL);
         for(Meta meta : postMeta) {
            stmt.setLong(1, postId);
            stmt.setString(2, meta.key);
            stmt.setString(3, meta.value);
            stmt.executeUpdate();
         }
      } finally {
         ctx.stop();
         SQLUtil.closeQuietly(conn, stmt);
      }
   }
937195
public void route(Route route) {
        // Can be called only once, with a non null route.
        Preconditions.checkState(this.route == null);
        Preconditions.checkNotNull(route);
        this.route = route;
    }
104867
private void update(int index)
    {
        int delta = receivedIndex - index;

        /* update the replay bit mask */
        if (delta > 0)
        {
            replayWindow = replayWindow << delta;
            replayWindow |= 1;
        }
        else
        {
            replayWindow |= ( 1 << delta );
        }

        receivedIndex = index;
    }
327966
@RequirePOST
    public HttpResponse doDiscard(StaplerRequest req, StaplerResponse rsp) {
        saveAndRemoveEntries( new Predicate<Map.Entry<SaveableReference,VersionRange>>() {
            @Override
            public boolean apply(Map.Entry<SaveableReference, VersionRange> entry) {
                return entry.getValue().max == null;
            }
        });

        return HttpResponses.forwardToPreviousPage();
    }
95098
public function addSecondaryIndex(Index $index)
    {
        if ($this->isEmbeddedDocument) {
            throw MappingException::embeddedDocumentsNotIndexable($this->getName());
        }

        if (isset($this->secondaryIndexes[$index->getName()])) {
            throw MappingException::indexExists($this->getName(), $index->getName());
        }

        $this->secondaryIndexes[$index->getName()] = $index;
    }
81294
def _transport_interceptor(self, callback):
        """"""

        def add_item_to_queue(header, message):
            queue_item = (
                Priority.TRANSPORT,
                next(
                    self._transport_interceptor_counter
                ),  # insertion sequence to keep messages in order
                (callback, header, message),
            )
            self.__queue.put(
                queue_item
            )  # Block incoming transport until insertion completes

        return add_item_to_queue
1374994
void index(int indexToNavigateTo) {
        this.index = 0;
        this.offset = 0;
        this.nextSplit = StringUtil.indexOf(path, '.', 0);
        this.token = null;

        for (int i = 1; i <= indexToNavigateTo; i++) {
            if (!advanceToNextToken()) {
                throw new IndexOutOfBoundsException("Index out of bound " + indexToNavigateTo + " in " + path);
            }
        }
    }
285786
private function getRoutesFromIndex (&$routes, &$routesIndex, &$requestMethod, &$requestPathParts, $requestPathIndex = 0) {
        if (!empty($requestPathParts[$requestPathIndex])) {
            $requestPathPart = $requestPathParts[$requestPathIndex];
            if (array_key_exists($requestPathPart, $routesIndex)) {
                $this->getRoutesFromIndex($routes,$routesIndex[$requestPathPart], $requestMethod, $requestPathParts, $requestPathIndex + 1);
            }
            if (array_key_exists(self::ROUTE_PARAMETER_WILDCARD, $routesIndex)) {
                $this->getRoutesFromIndex($routes,$routesIndex[self::ROUTE_PARAMETER_WILDCARD], $requestMethod, $requestPathParts, $requestPathIndex + 1);
            }
        }
        else if (array_key_exists(self::ROUTE_ACTIONS_KEY, $routesIndex)) {
            $testRoutes = &$routesIndex[self::ROUTE_ACTIONS_KEY];
            if (array_key_exists($requestMethod, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[$requestMethod], $requestMethod,$requestPathParts);
            }
            if (array_key_exists(self::ROUTE_GENERIC_METHOD, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[self::ROUTE_GENERIC_METHOD], $requestMethod, $requestPathParts);
            }
        }

        if (array_key_exists(self::ROUTE_GENERIC_ACTIONS_KEY, $routesIndex)) {
            $testRoutes = &$routesIndex[self::ROUTE_GENERIC_ACTIONS_KEY];
            if (array_key_exists($requestMethod, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[$requestMethod], $requestMethod, $requestPathParts);
            }
            if (array_key_exists(self::ROUTE_GENERIC_METHOD, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[self::ROUTE_GENERIC_METHOD], $requestMethod, $requestPathParts);
            }
        }
    }
98457
private void filterAfter(Route route) {
        try {
            List<HttpSupportFilter> filters = Configuration.getFilters();
            for (int i = filters.size() - 1; i >= 0; i--) {
                HttpSupportFilter filter = filters.get(i);
                if(Configuration.getFilterMetadata(filter).matches(route)){
                    LOGGER.debug("Executing filter: " + filter.getClass().getName() + "#after");
                    filters.get(i).after();
                }else {
                    LOGGER.debug("Filter: " + filter.getClass().getName() + "#after does not match route: " + route );
                }
            }
        } catch (Exception e) {
            throw new FilterException(e);
        }
    }
1325222
private function intercept(array &$interceptors, &$request, &$method, &$metadata, &$options, callable $callback)
    {
        /** @var Client\Interceptors\Base $i */
        $i = array_shift($interceptors);
        if ($i) {
            $i->setRequest($request);
            $i->setMethod($method);
            $i->setMetadata($metadata);
            $client = $this->getClient();
            $i->setStub($client);
            return $i->call(function () use (
                &$i,
                &$interceptors,
                &$method,
                &$request,
                &$metadata,
                &$options,
                &$callback
            ) {
                $metadata = $i->getMetadata();
                $request = $i->getRequest();
                if (count($interceptors) > 0) {
                    return $this->intercept($interceptors, $request, $method, $metadata, $options, $callback);
                } else {
                    return $callback();
                }
            });
        } else {
            return $callback();
        }
    }
451887
public Routes addInterceptor(Interceptor interceptor) {
		if (com.jfinal.aop.AopManager.me().isInjectDependency()) {
			com.jfinal.aop.Aop.inject(interceptor);
		}
		injectInters.add(interceptor);
		return this;
	}
475138
public void refresh(String index) throws IOException {
        logger.debug("refresh index [{}]", index);

        String path = "/";

        if (index != null) {
            path += index + "/";
        }

        path += "_refresh";

        Response restResponse = lowLevelClient.performRequest("POST", path);
        logger.trace("refresh raw response: {}", asMap(restResponse));
    }