I haven't done this yet, but eventually I will have to.

My intended solution was to have a single Home/Remote Interface pair and just
provide multiple implementations of the bean class.  Each bean would be
registered with a separate name in JNDI and the client would just look up the
version of the bean that it needs.  Since they all have the same Home/Remote
Interface pair, the casting would be exactly the same for all implementations.

Is this not the expected way to do this in J2EE?

- Tim Haley


----- Original Message -----
From: "Chris Adams" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 02, 2001 3:17 PM
Subject: [JBoss-user] Casting home interface to correct bean type


> Hi,
>
> Need some help with remote casting objects when using ejb's
>
> I'm going to have a set of bean which each represent a form. Each for has
> the same set of methods, but they need to be independent ejb's because
each
> has different details.
>
> The client is a servlet, which will receive a parameter
> the type of form to return. This then needs to get the home interface of
> the bean. I am going to have a properties file which pairs the form name
to
> it's home interface class name.
>
> My problem is that the lookup method just returns an object, so how can I
> cast this object to the correct home interface, as the type of form is not
> know until the servlet is called.
>
> I've tried creating standard interfaces, which all form beans could
inheret
> from, but came up with all sort of problems.
>
> I could use relfection to call the methods, but would prefer not to. Any
> ideas.
>
> Many Thanks
>
> Chris Adams



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to