?
Solved

EJB convert between local and remote interface

Posted on 2002-07-11
4
Medium Priority
?
468 Views
Last Modified: 2013-11-24
Hi

I am writing an EJB. I want to be able to convert from local to remote interface, and from remote to local interface.

If f.ex I have a EJB called ABean, with local interface ALocal and remote interface ARemote. How can I get the ALocal interface when I have the corresponding ARemote interface. And how can I get the ARemote interface when I have the corresponding ALocal interface.

Thanx
0
Comment
Question by:steff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Expert Comment

by:klf
ID: 7145775
Use the EBJ's SessionContext, EntityContext, or MessageDrivenContext object. These have getEJBLocalObject and getEJBObject methods.  As the names suggest SessionContext is use with session beans, EntityContext is used with entity beans, and MessageDrivenContext is use with message driven beans.


 
0
 

Author Comment

by:steff
ID: 7145826
According to the JavaDoc that comes with JBuilder 6, SessionContext only has getEJBObject, and NOT getEJBLocalObject.

Is the JavaDoc wrong?
0
 
LVL 1

Accepted Solution

by:
klf earned 400 total points
ID: 7145866
What version of the EJB  does JBuilder 6 implement?  
My information came from the Mastering Enterprise JavaBeans (2nd Editon) book that covers EJB 2.0.  Accoring to this SessionContext must implement the EJBContext interface that has a getEJBLocalObject interface.  But since it's a container object JBuilder may have chosen not to provide a working implementation of getEJBLocalObject.  

0
 
LVL 35

Expert Comment

by:girionis
ID: 8917198
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to klf

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month12 days, 4 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question