• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on No-Interface View

 
Ranch Hand
Posts: 211
Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ranchers ,
I was reading this snippet in spec


3.4.4Session Bean’s No-Interface View
The container provides an implementation of a reference to a no-interface view such that when the client invokes a method on the reference, the business method on the session bean instance and any interceptor methods are invoked as needed.


I dint understood "..any interceptor methods are invoked as needed.".Can someone explain me why would i require an interceptor and an example of a scenario will be very helpful.

The Spec has also mentioned very similar quote


3.4.3Session Bean’s Business Interface
The container provides an implementation of a session bean’s business interface such that when the client invokes a method on the instance of the business interface, the business method on the session bean instance and any interceptor methods are invoked as needed


Please help me on both of this quotes in context to interceptors.


Also can some one explain why can i call only public methods through a no interface view otherwise EJBException.Why so the spec have made this as compulsion there must be some logic or reason behind which i am not aware ???


Regards,
Shroff.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

the meaning of these snippet is that the interceptors can be binded to business methods (but not only) and they are invoked before the request enter to the business method.

request can be like this:

reference------>ejb container------>interceptor------>business method

Also can some one explain why can i call only public methods through a no interface view otherwise EJBException.Why so the spec have made this as compulsion there must be some logic or reason behind which i am not aware ???



This rule allows developers to hide some methods which they don't want to expose outside their bean (for example callback methods or private methods).
 
Sagar Shroff
Ranch Hand
Posts: 211
Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michal Nalewajko wrote:
This rule allows developers to hide some methods which they don't want to expose outside their bean (for example callback methods or private methods).


can you give me an example of such scenario ? Because its still unclear to me , because hiding of method could be controlled through access-specifiers i would had made my method private then why such rule ? ?

Regards,
Shroff.
 
reply
    Bookmark Topic Watch Topic
  • New Topic