• Post Reply Bookmark Topic Watch Topic
  • New Topic

Implementing Remote and local interface at the same time ?  RSS feed

 
Rashmi Tambe
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can an enterprise bean have remote and local interfaces at a time? i.e can a bean have remote and local client at the same time? it it allowed? If this is allowed, then a bean should have a remote and local interface, also a remote home and local home interface. In that case, should the remotly exposed methods be same as locally exposed methods ?
thanks in advance
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is possible to have both remote and local interfaces for a bean. It is not required that methods exposed in the component interface(local and remote)be the same .
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Pradeep says, it is definitely possible, though it happens in less cases than you may think. For the most part code written for local clients is not coarse-grained enough to be used as for remote clients. Therefore, I rarely find the need to write an ejb to support both. In fact, I don't typically find the need to write ejbs that are remoteable at all since I always try to co-located the web tier whenever possible.
Regardless, the problem that some people have in this respect is that I still see alot of ejb code which throws RemoteExceptions from the Bean Implementation class. Since local interfaces are not allowed to throw RemoteExceptions the developers then run into trouble deploying the ejbs. Other than that it is a fairly straight-forward exercise to implement both types of interfaces.
[ August 27, 2003: Message edited by: Chris Mathews ]
 
Rashmi Tambe
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Chris and Pradeep !
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!