Menu

#66 Gen constants for ejb-ref COMP_NAMEs

open
nobody
ejbdoclet (28)
5
2002-07-09
2002-07-09
No

XDoclet should generate constants for the
COMP_NAMEs declared in the ejb-refs for a bean.

Ie For BeanA that has an ejb-ref to BeanB, I declare an
ejb:ejb-ref (or
ejb:ejb-external-ref) tag and an appserver tag to bind the
BeanB's COMP_NAME
to a JNDI_NAME for BeanA. During BeanA's
setSessionContext() I would like to
resolve the reference to BeanB's Home using the
COMP_NAME. At the moment you must manually
include a second String specifying the same
COMP_NAME as
declared in the ejb-ref tag in BeanA's header.

It seems sensible to automatically generate the
COMP_NAME constant for beans that are *referenced*.

NB The BeanUtil class that XDoclet can generate is not
a solution as it (aberrantly IMO) generates a
COMP_NAME for the bean itself and the beans
that are referenced.

Kind of like putting the cart before the horse :-)

Discussion

  • Andy Stevens

    Andy Stevens - 2002-07-10

    Logged In: YES
    user_id=247081

    For that matter, why do we generate the COMP_NAME and
    JNDI_NAME in the Home interface, rather than in the Util
    class that uses them? Is it just historical (they predate the
    Util class generation), or is there some other reason?

    Having them in the Home is causing me problems with
    Powerbuilder proxy object generation for my EJBs, which
    would go away if the constants were in the utility class
    instead.

     
  • William Ferguson

    Template that creates constants class for EJB client

     
  • William Ferguson

    Logged In: YES
    user_id=558701

    IMO the COMP_NAME shouldn't reside on either the HOME
    or Util class of the target bean. The COMP_NAME is specific
    to the client that is targetting the bean.

    The JNDI_NAME is another matter as it is absolute.

    We use the attached XDoclet Template to get most of the
    way there.

     

Log in to post a comment.