Author: Francois le Roux (---.connect.com.au)
I've coded a generic threadmanager type service component (within an app. server) that instantiates various EJB's dynamically depending on various criteria that I obtain from a database. My code looks something like this - I run each of these type calls in a seperate thread:
javax.naming.Context ctx = new javax.naming.InitialContext ();
RO.ContractHHHome home = (RO.ContractHHHome)ctx.lookup("Contract/contractHH");
RO.ContractHHRemote remote = home.create();
I've managed to find an alernative way way to cast my EJB's to a CorbaOrb object and hence I'm avoiding to have to know exactly what my EJB's class name is at compilation time(i.e the reference to the object RO.ContractHHHome can then be revoked at compilation time).
initialContext.init( orbOptions ) initialContext.String_to_Object(this.location, corbaobject )
corbaobject = lses_session.lookup(bindNaming)
However, this opt's the problem that unless my CorbaOrb object is inherited from a super class that is known to me, there is NO way that I can call any custom methods on the CorbaOrb object that has been casted from my EJB (i.e. RO.ContractHHHome). So how do I cast/inherit the CorbaOrb object so that I can reference a custom method via the remote interface of the EJB. Sorry for this bad explaination - I will gladly explain more if need be....