aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Interceptors i ejb 3.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Interceptors i ejb 3.0" Watch "Interceptors i ejb 3.0" New topic
Author

Interceptors i ejb 3.0

Lalit mishra
Ranch Hand

Joined: Sep 01, 2005
Posts: 99
1. If i use Interceptors for a bean
then the interceptors would be appliesd to all
business methods.
MI Mohammed
Ranch Hand

Joined: Feb 16, 2005
Posts: 146
@mishra
Interceptors can have basically three access levels.
1. Application ie with ejb-jar file
This are called default interceptors. The affect all
classes with their methods. Can only be specify in DD.
But Classes and method can be configured to ignore it.

2. The next is Class interceptor, yap, once declared
it is applicable to all the class methods, again except
it is ignored using dependency injector or DD.

3. Method level, apply to the method in which it is applied.

Also not the the transition is addictive, ie if interceptors are applied
to the application(default), ame for all class methods.
Check the spec for more details.
Hope it helps.


SCJA(Beta) SCJP 1.4 SCWCD 1.4 SCBCD 1.3 SCBCD 5.0 beta <br />The more practice we get, the better we are at the exams and in life in general. Pls join me at My DEN.
Lalit mishra
Ranch Hand

Joined: Sep 01, 2005
Posts: 99
Thanks for the help
gaurav singhal
Ranch Hand

Joined: Nov 18, 2005
Posts: 135
Thanks for a good piece of information can you pllease tell the syntax for class scope Interceptor and method scope Interceptor
Rajan Murugan
Ranch Hand

Joined: Jun 24, 2006
Posts: 182
Originally posted by gaurav singhal:
Thanks for a good piece of information can you pllease tell the syntax for class scope Interceptor and method scope Interceptor


You would normally use @Interceptors(...) annotation just before the class or the method.You can also achieve this using xml dd.

In the above (...) ... is a single argument which specifies the interceptor class.So it can be myInterceptor.class.


With Regards,<br /> Rajan<br />"Java Rocks"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interceptors i ejb 3.0
 
Similar Threads
Questions about tx in Spring
Invocation Order of Interceptors
interceptor problem in struts2
Struts2 in Action: Book Question
problem with struts2 checkbox