Hi,
I have something demonstrated on my system using JBoss7.1.1 application server, where I used EJB3.1 stateless session bean with @Timeout method with interceptor and it works! This contradicts to Frits Enterprise
Java Beans 3.pdf document. Correct me if I'm wrong in the interpretation of the document.
In the document on page 42 it says,
Quote:
@Interceptors({PrincipalLogger.class}) interceptor is not called on @Timeout method
@Timeout
public void timerSignal(){
System.out.println("Timer time-out");
}
Below is my code which works,
CalculatorBean.java (for brevity I have not added CalculatorLocal and CalculatorRemote classes)
Code:
CalculatorLoggingInterceptor.java
Code:
Sample output -
Code:
I'm re-using the method log() as business method interceptor and @timeout method interceptor methods. Also, note that annotating backgroundProcessing() as @Schedule, also works fine!
Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)