Solved

EJB convert between local and remote interface

Posted on 2002-07-11
4
450 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now