• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help!!! can Remote Client pass itself as parameter to Bean's business method?

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Due to my machine's enviroment setting got something wrong, so I cannot do the test for my question now, hoping you guys' can give me some advices:

Suppose we have a remote client:

public class AdviceClient {
...
//suppose we already get the EJB home interface back, the SuggestionGiver
//is the component interface
SuggestionGiver sg = home.create();
String suggestion = sg.getSuggestion(this);
...
public void fromClient() {
...
}
}

if the remote client can really pass itself, then that means the client is available for bean's business method, then the bean's business method can invoke Client's method (here is fromClient() method)

I know, passing client itself is a little weird, but technically, is it fine?

Thanks a lot in advance.

Hai
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Definitely not! If the "client" as you put it, is a remote bean itself then you can pass a handle, or the EJBObject I believe (entityContext.getEJBObject()). But your code as you have it certainly wouldn't work since the client is in a different execution context or maybe on the other side of the planet.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic