Java Reference
In-Depth Information
return ctx.proceed();
@Schedule(minute="*/2", hour="*")
public void executeEvery2Second(){"executeEvery2Second -
executeEvery5Second - date: "+new Date());
public Object
ctx) throws Exception{"targetClassTimerInterceptor -
method :"+ctx.getMethod().getName()+", timer :
return ctx.proceed();
Defining interceptors in an interceptor class
The following code shows a class that can be used as an interceptor. To complete
this class, we extract the interceptor methods contained in the StudentSes-
sionBean class. As you can see, this class has no special annotation. But to be
explicit, you can decorate it with javax.interceptor.Interceptor annotation
(in our case, we have not done it to show you that this is optional).
public class MyInterceptor {
private Logger logger = Logger.getLogger(
public Object
ctx) throws Exception{
Search WWH ::

Custom Search