• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Ways to get hold of RemoteInterface

 
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Please correct me if I'm wrong. I suppose that there are three ways to get hold of the RemoteInterface reference as below,

(1) Through @EJB annotation
(2) Through @Resource annotation
(3) Through JNDI lookup (If the client is remotely deployed)

Any suggestions?
 
Joe Harry
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggestion guys?
 
Ranch Hand
Posts: 329
Oracle Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Jothi Shankar Kumar Sankararaj:

(1) Through @EJB annotation
(2) Through @Resource annotation
(3) Through JNDI lookup (If the client is remotely deployed)



How would you get a reference through the @Resource annotation?

I can only think of these 3 ways:

1) Dependency injection using the @EJB annotation
2) Dependency injection using the ejb-ref ejb-local-ref elements of the deployment descriptor.
3) By doing a JNDI lookup using the javax.naming.Context interface or the EJBContext.lookup() method.
[ September 05, 2008: Message edited by: Sergio Tridente ]
 
Joe Harry
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Resource SessionContext sessionContext
 
Joe Harry
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any ideas on the post above?
 
Sergio Tridente
Ranch Hand
Posts: 329
Oracle Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Jothi Shankar Kumar Sankararaj:
@Resource SessionContext sessionContext



I would't call it a way for obtaining a RemoteInterface. It is a way for obtaining the SessionContext object. You can then, of course, use the lookup() method on that object to get the RemoteInterface reference, but it is still a JNDI lookup.
[ September 08, 2008: Message edited by: Sergio Tridente ]
 
Joe Harry
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Sergio Tridente:


I would't call it a way for obtaining a RemoteInterface. It is a way for obtaining the SessionContext object. You can then, of course, use the lookup() method on that object to get the RemoteInterface reference, but it is still a JNDI lookup.

[ September 08, 2008: Message edited by: Sergio Tridente ]



Thanks Sergio, you have been helpful!
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as i know, the @Resource can be used to inject any resource from the JNDI. So injecting a remote bean should also be possible. I was thinking of doing this as follows:

 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic