Class LimiterAspectSupport

java.lang.Object
org.aoju.bus.limiter.intercept.LimiterAspectSupport
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.SmartInitializingSingleton
Direct Known Subclasses:
LimiterInterceptor

public abstract class LimiterAspectSupport extends Object implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.SmartInitializingSingleton
实际的advisor 使用beanfactory的一些基础设施
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • LimiterAspectSupport

      public LimiterAspectSupport()
  • Method Details

    • execute

      protected Object execute(org.aopalliance.intercept.MethodInvocation invocation, Object target, Method method, Object[] args) throws Throwable
      执行
      Parameters:
      invocation - 反射
      target - 目标
      method - 方法
      args - 参数
      Returns:
      the object
      Throws:
      Throwable - 异常
    • afterSingletonsInstantiated

      public void afterSingletonsInstantiated()
      Specified by:
      afterSingletonsInstantiated in interface org.springframework.beans.factory.SmartInitializingSingleton
    • setBeanFactory

      public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
      Specified by:
      setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
      Throws:
      org.springframework.beans.BeansException
    • limitContexts

      protected LimitContextsValueWrapper limitContexts(Collection<LimiterExecutionContext> contexts)
    • releaseContexts

      protected void releaseContexts(Collection<LimiterExecutionContext> contexts)
    • getLimiterOperationContexts

      protected Collection<LimiterExecutionContext> getLimiterOperationContexts(Collection<LimitedResource> limitedResources, Method method, Object[] args, Object target, Class<?> targetClass)
    • getLimitedResourceSource

      public LimitedResourceSource getLimitedResourceSource()
    • setLimitedResourceSource

      public void setLimitedResourceSource(LimitedResourceSource limitedResourceSource)
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean