Hi,
we want to talk to EJB's in a generic way. This means we have a set of EJB's
(the set may be expanded), all with the same functions, only difference is
their implementation.
Take a "public void send(String message)" method for example.
Is it possible to look up these different beans with only a difference in
the JNDI name?
I tried but could not succeed, but that's not surprising me being fairly new
to EJB's.
In the code we see this:
Context context = new InitialContext(env);
Object obj = context.lookup(jndi);
//specific code
Prot_AHome home =
(Prot_AHome)PortableRemoteObject.narrow(obj, Prot_AHome.class);
Prot_A bean = home.create();
bean.send(message);
With Prot_A being the class of one of the EJB's. We want to add Prot_B,
Prot_B,etc. Is there any way we can use an interface for this? So the code
would be:
ProtHome home = (ProtHome)PortableRemoteObject.narrow(obj,
ProtHome.class);
Prot bean = home.create();
bean.send(message);
and the only difference would be in the JNDI name. Someone said it could not
be done 'cause of a not really Object Oriented Design of EJB's home
interface or something.
Is this true? And if so, why was this design decision taken?
Any help would be welcome,
regards
Bas Eefting
***********************************************************************
This E-Mail Message is intended exclusively for the addressee. If the
E-Mail was sent to you in error, please notify the sender immediately
by replying to this E-mail. We would then request you to destroy the
E-Mail and neither to use nor disclose the contents in any manner to
third parties, as the message could contain confidential information
which may be protected by the professional secrecy act.
This footnote also confirms that this E-mail message has been swept for
computer viruses.
***********************************************************************
===========================================================================
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".