类 ConcurrencyThrottleSupport

    • 字段详细资料

      • NO_CONCURRENCY

        public static final int NO_CONCURRENCY
        Switch concurrency 'off': that is, don't allow any concurrent invocations.
        另请参阅:
        常量字段值
      • logger

        protected transient Log logger
        Transient to optimize serialization.
    • 方法详细资料

      • setConcurrencyLimit

        public void setConcurrencyLimit​(int concurrencyLimit)
        Set the maximum number of concurrent access attempts allowed. -1 indicates unbounded concurrency.

        In principle, this limit can be changed at runtime, although it is generally designed as a config time setting.

        NOTE: Do not switch between -1 and any concrete limit at runtime, as this will lead to inconsistent concurrency counts: A limit of -1 effectively turns off concurrency counting completely.

      • getConcurrencyLimit

        public int getConcurrencyLimit()
        Return the maximum number of concurrent access attempts allowed.
      • isThrottleActive

        public boolean isThrottleActive()
        Return whether this throttle is currently active.
        返回:
        true if the concurrency limit for this instance is active
        另请参阅:
        getConcurrencyLimit()
      • beforeAccess

        protected void beforeAccess()
        To be invoked before the main execution logic of concrete subclasses.

        This implementation applies the concurrency throttle.

        另请参阅:
        afterAccess()
      • afterAccess

        protected void afterAccess()
        To be invoked after the main execution logic of concrete subclasses.
        另请参阅:
        beforeAccess()