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 |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.