Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interceptors i ejb 3.0

 
Lalit mishra
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. If i use Interceptors for a bean
then the interceptors would be appliesd to all
business methods.
 
MI Mohammed
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@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.
 
Lalit mishra
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help
 
gaurav singhal
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic