Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Arnold Reuser
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 :




 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic