Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

@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: 476
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: 3390
311
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: 476
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.
reply
    Bookmark Topic Watch Topic
  • New Topic