I've done something a little different, but which may
solve your problem:
I have several EJBeans that all share common remote and
home interface, but have different implementations.
The are all defined seperately in the deployment
descriptor, with unique jndi names.
When I want to retrieve a particular imnplementation, I
call a method which takes the jndi name of that
implementation (jndiName):
...
conditioner remote;
try
{
Context initial = getInitialContext();
Object objref = initial.lookup(jndiName);
conditionerHome home =
(conditionerHome)PortableRemoteObject.narrow(objref,
conditionerHome.class);
remote = home.create();
...
The client never needs to know what implementation beans
are available.
> Somebody pls. suggest me to do the following :
>
> InitialContext ic = new InitialContext();
> BpHome home = (BpHome)ic.lookup("jndiBpHome");
>
> If BpHome(Home interface of an EJB) is in a String variable, then how can I
> perform same as above. i.e.
>
>
> String HomeStr = "BpHome";
> InitialContext ic = new InitialContext();
> HomeStr home = (HomeStr)ic.lookup("jndiBpHome");
>
>
> I know that this will now work, somebody pls. suggest me the way to do this.
> It's very urgent.
>
> Thanks in advance.
>
> Tarun
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".