Hi,
I have experiemented with similar idea. But I am not sure it's worth
doing it.
Here is what I had done:
I have a Stateless EJB session Bean, called ControllerBean()
The Controller Interface expose
public Object createService(String jndiName, Class clazz )
API. Where the jndiName is the JNDI_NAME For the target home interface,
and clazz is the home interface class.
Client can make following call to get the particular Service requested:
For example: For an AssetManager Session Bean,
Object obj = m_controller.createService(AssetManagerHome.JNDI_NAME,
AssetManagerHome.class);
m_assetManager = (AssetManager) PortableRemoteObject.narrow(obj,
AssetManager.class);
The createService() method will do lookup based on the AssetManagerHome
and class.
Even this is doable, but I am not sure it worth doing it.
If client knows there is an Service called AssetManager
He would simply do the following:
m_ctx = getInitialContext();
AssetManagerHome assetManagerHome =
(AssetManagerHome)
PortableRemoteObject.narrow(m_ctx.lookup(AssetManagerHome.JNDI_NAME),
AssetManagerHome.class);
assetManager= (AssetManager) assetManagerHome.create();
Again, this is just what I have experiemented, it may not be what you have
in mind.
Chester
> -----Original Message-----
> From: Milen Dyankov [mailto:mdyankov@(protected)]
> Sent: Monday, February 02, 2004 3:19 AM
> To: J2EE-INTEREST@(protected)
> Subject: pluggable EJB modules
>
>
> Hi all,
>
> I'm thinking of writing J2EE application and I wander if I can make my
> EJB modules somewhat pluggable.
> What I mean is having one main EJB module (say MainApp) which
> looks for
> another modules under given JNDI names.
> For example I may look for accounting module under
> "MainApp/accounting",
> HR module under "MainApp/hr", etc.
> Then for example I can have many, customer specific,
> accounting modules
> (using different databases, data structures, etc..).
> As long as they all have one and the same main controller bean (say
> ControlerSLSB) I will be able to deploy
> (or not deploy at all if not needed) a different version of any given
> module for different customer.
>
> What I'm thing to do is web front-end for a few different
> applications.
> Suppose a customer A uses some HR management software which is
> completely different from the software company B uses.
> If I can develop my application to use modules I would have all
> application logic (reports, analysis, forecasts, ...)
> in my main application and simply deploy a specific module to
> communicate with underlying application.
>
> Does this make any sense? So far I see no reason why
> something like this
> should not work,
> but it already happened to me that things I have considered simple,
> turned out to be impossible.
>
> Is what I'm trying to do a common thing or rather a weird one?
>
> Any comments will be highly appreciated!
>
> Thanks,
> Milen Dyankov
>
> ==============================================================
> =============
> To unsubscribe, send email to listserv@(protected)
> include in the body
> of the message "signoff J2EE-INTEREST". For general help,
> send email to
> listserv@(protected)".
>
===========================================================================
To unsubscribe, send email to listserv@(protected)
of the message "signoff J2EE-INTEREST". For general help, send email to
listserv@(protected)".