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
Solved

EJB convert between local and remote interface

Posted on 2002-07-11
4
456 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
  • 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 100 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
diffSum example 4 50
eclipse with Angularjs2.0 3 57
ejb entity bean example issue 2 16
Running JavaFX on the Raspberry Pi 27 41
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

860 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