Spring Java

File: context.xml

    "http://www.springframework.org/dtd/spring-beans.dtd">

  
    
      
        
      
    
    
      
        
      

    
    
  
          class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor"
        singleton="false">
    
    
  
          class="org.springframework.aop.interceptor.ConcurrencyThrottleInterceptor"
        singleton="false">
    
  

File: Main.java
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.util.StopWatch;
public class Main {
  public static void main(String[] args) throws Exception {
    BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("context.xml"));
    MtBean testBean = (MtBean) beanFactory
        .getBean("afterBean");
    testBean.showValues();
  }
}
class MtBean {
  private String firstName;
  public String getFirstName() {
    return this.firstName;
  }
  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }
  public void showValues() {
    System.out.println("First name: " + this.firstName);
  }
}
           
       
Spring-ConcurrencyThrottleInterceptor.zip( 2,894 k)