Hello K.J.,

Yes, it's possible.
If your bean is in "ejb/BeanB" and you want to put it in "ejb/BeanC"
use:

     javax.naming.Context ctx=new javax.naming.InitialContext();
     BeanBHome b = (BeanBHome) ctx.lookup("ejb/BeanB"); // ok, fine
     ctx.bind("ejb/BeanC",b);

     now:
     BeanBHome c = (BeanBHome) ctx.lookup("ejb/BeanC");
     should work.

     Note: If you want to change the Object bound to a name, use
     ctx.rebind instead.
     
KKJ> Dear All,

KKJ> I'm wondering how I can register EJB's on the fly in Orion. Say I have a
KKJ> bean that is registered and known. As the program runs I decide I also want
KKJ> it registered under a different name in the JNDI registry.

KKJ> thus, in pseudo code:
KKJ>     BeanBHome b = lookup("ejb/BeanB"); // ok, fine
KKJ>     BeanBHome c = lookup("ejb/BeanC"); // *agk!* fails
KKJ>     jndi.register("ejb/BeanC", BeanBHome);
KKJ>     BeanBHome c = lookup("ejb/BeanC"); // ah, now it works!

KKJ>     Kees Jan


-- 
Best regards,
 Rafael                            mailto:[EMAIL PROTECTED]



Reply via email to