aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Question on No-Interface View Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Question on No-Interface View" Watch "Question on No-Interface View" New topic
Author

Question on No-Interface View

Sagar Shroff
Ranch Hand

Joined: Jun 07, 2011
Posts: 208

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.


OCJP-90%,OCPWCD-95%
Michal Nalewajko
Greenhorn

Joined: Mar 07, 2013
Posts: 7
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

Joined: Jun 07, 2011
Posts: 208

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question on No-Interface View