In this tutorial you will see how Interceptor throttles concurrent access.
In this tutorial you will see how Interceptor throttles concurrent access.In this example you will see, Interceptor that throttles concurrent access, blocking invocations if a specified concurrency limit is reached.
StudentBean.java
package roseindia.net; public class StudentBean { String studentName; String studentCourse; public String getStudentName() { return studentName; } public void setStudentName(String studentName) { this.studentName = studentName; } public String getStudentCourse() { return studentCourse; } public void setStudentCourse(String studentCourse) { this.studentCourse = studentCourse; } public void showValue() { System.out.println("Show Results:" + this.studentName + " " + this.studentCourse); } }
MainClaz.java
package roseindia.net; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; import org.springframework.core.io.ClassPathResource; public class MainClaz { public static void main(String[] args) { BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource( "spring/context.xml")); StudentBean studentBean = (StudentBean) beanFactory.getBean("testBean"); studentBean.showValue(); } }
context.xml
<?xml version="1.0" encoding="UTF-8"?>
|
Show Results:James Bond, B.Tech |