Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Hai Lin
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • 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
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!