homemy accounthelp


JUGCentral
 New Topic  |  Go to Top  |  Go to Topic  |  Search   Newer Topic  |  Older Topic 
 Topic: Casting in EJB's - please help?!!
Author: Francois le Roux (---.connect.com.au)
Date:   :49

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();
remote.setAppKey(getAppKey());
remote.startProcess();
remote.remove();

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 )
lcor_corbaobject._narrow(appManager, "SessionManager/Manager")
appManager.createSession(this.userid, "")
corbaobject = lses_session.lookup(bindNaming)
corbaobject._narrow(homeOrb, ejbHome)

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....


many thanks
francois

Reply To This Message
 
 Re: Topic: Casting in EJB's - please help?!!
Author: Francois le Roux (---.connect.com.au)
Date:   :19

I figured ir out - i make use of "relection"

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 
 Reply To This Message
 Your Name:
 Your E-mail:
 Subject:
   

phorum.org