File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes How to switch between local and remote interfaces by using the deployment descriptors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "How to switch between local and remote interfaces by using the deployment descriptors" Watch "How to switch between local and remote interfaces by using the deployment descriptors" New topic
Author

How to switch between local and remote interfaces by using the deployment descriptors

Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 196
Is it possible to switch the business interface of a session bean from a local to a remote business interface solely by using the deployment descriptors in a Java EE 5 compatible manner ?
Up till now I couldn't find an example, post or reference related to this topic.

The following is just to add more detail to the stated question :


Because no annotation is specified at MyBusinessInterface the business interface will by default be a local business interface.
So my question is how I can tweak the deployment descriptors so that MyBusinessInterface will behave like a remote business interface.
The answer will provide me the ability to adjust the intent of the business interface - local or remote - during deployment instead of during development.








Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 196
Note I do not have an answer to the following question :

Is it possible to switch the business interface of a session bean from a local to a remote business interface solely by using the deployment descriptors in a Java EE 5 compatible manner ?

But just in case anyone is interested. I do, however, have a workaround that I consider to be an ugly hack.
The ideal solution would have just one interface and will use the deployment descriptors to determine whether the intent of usage of the business interface is remote or local.
The rest of this post is about the workaround I am currently using.

Recipe of how to switch between the usage of a local and remote interface :

The first step required is to define both local and remote business interfaces.

The second step is to make the switch based on the usage of ejb-ref or ejb-local-ref.
The following example is provided to add more detail to this :




 
Don't get me started about those stupid light bulbs.
 
subject: How to switch between local and remote interfaces by using the deployment descriptors