• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

@Remote and @Local

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 133
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 499
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)?
 
Creator of Enthuware JWS+ V6
Posts: 3412
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 499
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Police line, do not cross. Well, this tiny ad can go through:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic