• 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:

Session object�s local interface

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Kathy and all EJB Developers!
My question is:
In this statement: �A client can pass a local home object reference to another application through its local interface.�
What does �...through its local interface� mean?
Does it mean a local home object reference CAN be passed by one of the methods defined in its local interface?
Thank you very much!
EJB Specs:
6.7.2 References to session object local interfaces:
_______________________________
...
It is invalid to reference a session object that does not exist. Attempted invocations on a session object
that does not exist result in javax.ejb.NoSuchObjectLocalException.
A reference to a session object�s local interface (i.e., a session EJBLocalObject) must not be passed out
of the JVM in which it was created. A client can pass a local home object reference to another application
through its local interface. A local home object reference cannot be passed as an argument or result
of a method on an enterprise bean�s remote home or remote interface.
_______________________________
[ May 22, 2003: Message edited by: Seid Myadiyev ]
[ May 22, 2003: Message edited by: Seid Myadiyev ]
[ May 22, 2003: Message edited by: Seid Myadiyev ]
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IMO, 'through its local interface' refers to application's local interface. It means the local reference can be passed as an argument to another application if local interfaces are used (if all aplications reside in the same JVM). Passing it to a remote bean wouldn't make much sense. I suppose it's a contract restriction(as you quoted in the last part of your message). From the point of view of Java language, there's nothing wrong with it as long as the method accepts it.
To illustrate, think about a web application calling EJBs through local interfaces (do not do this at home ). At some point in time it obtains a reference to a local interface of the bean. Then, it's possible for this web application to call (again, only through local interface) another bean and pass this local interface to the bean as a method parameter.
The example stated above is only for illustrative purpose, it is in fact, a very bad design if you try to implement it in production system.
Anyone else with comments?
 
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic