Two Laptop Bag
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes LifeCycle Callback interceptor question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "LifeCycle Callback interceptor question" Watch "LifeCycle Callback interceptor question" New topic
Author

LifeCycle Callback interceptor question

Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
In LifeCycle Callback interceptors , I did not write invocationContext.proceed() has the last statment.
Still the interceptors associated with the buisness method was executed and finally buisness method was executed.
How is this possible ? since if invocationContext.proceed() is not the last statement then the rest of the interceptors
and finally the buisness methods do not execute.



Further the "init" set in ContextData of the above lifecycle callback interceptor was not visible in the other interceptors.
System.out.println("init:"+invocationContext.getContextData().get("init")); in other interceptors returned null. How is this possible?

From EJB IN Action
"That is the whole point of calling the InvocationContext.
proceed method in lifecycle interceptor methods as in the resource
logger code. This ensures that the next lifecycle interceptor method in the invocation chain or the bean lifecycle method is triggered."


SCJP, SCWCD, SCBCD
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

One thing you're not telling us is : do you see all the System.outs from this method in your log ?


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: LifeCycle Callback interceptor question
 
Similar Threads
Life-Cycle Event Interceptor Method Skipped
Exceptions in lifecycle callback methods (II)
Intergration of Struts2 and EJB3.0 using struts2-ejb3-plugin
Lifecycle callback interceptor
Exceptions in lifecycle callback methods (I)