• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@Remote and @Local

 
Padma Priya
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a few doubts from the EJB3.0 core spec which says

"While it is possible to provide both a remote client view and a local client view for an enterprise bean,
more typically only one or the other will be provided."

1)How is it possible to provide both a remote client view and a local client view for an enterprise bean. Does this mean i mark the bean interface for the session bean as both @remote and @local or write 2 interfaces and mark one with @Local and other with @Remote and have the bean class implement both of them.

2) "local calls involve pass-by-reference" and "Remote calls involve pass-by-value."

Can anybody explain the significance of the above 2 statements with an example.


Thanks in advance

With regards
Deepthi
 
Krzysztof Koziol
Ranch Hand
Posts: 133
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepthi Tirunahari wrote:

1)How is it possible to provide both a remote client view and a local client view for an enterprise bean. Does this mean i mark the bean interface for the session bean as both @remote and @local or write 2 interfaces and mark one with @Local and other with @Remote and have the bean class implement both of them.


You have to write 2 interfaces.


2) "local calls involve pass-by-reference" and "Remote calls involve pass-by-value."


It's impossible to pass the reference to the remote JVM.
 
Charles O'Leary
Ranch Hand
Posts: 42
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

more typically only one or the other will be provided


Why is this more typical (to provide either a remote or a local, rather than provide both)?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2345
90
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is this more typical (to provide either a remote or a local, rather than provide both)?

I guess this is common practice. Having used EJB's in the last couple of years I can conclude that I haven't used both annotations on the same EJB yet. Apart from during my EJB certification preparation time

However there could be reasons to use both.
 
Charles O'Leary
Ranch Hand
Posts: 42
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the confirmation.

I guess my coworkers and I can wrap things up in half the time going forward.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic