• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic