tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohammad Nour El-Din <>
Subject Re: suggestion for defining local ref name for session beans
Date Sun, 13 Sep 2009 08:20:46 GMT
Hi Mohammad Nourouzi...

  Seems that we almost have the same name ;). Well I think you are
missing things up here. The @EJB you are defining here are for
dependency injection (DI) so the container knows that you are
requiring this EJB to be injected into your class which
defined/declared this DI point. If using this way it not good for you
you still can lookup EJB explicitly using either:

1- The new lookup method in the EJB's context class.
2- By initializing a naming context and using the lookup method.

On Sun, Sep 13, 2009 at 6:01 AM, is_maximum <> wrote:
> Hello
> I have a session bean which is an entry point for calling a number of other
> session beans.
> Because this entry bean doesn't know which stateless should be called at
> runtime we need to lookup them. in order to lookup EJBs we must declare @EJB
> on this entry session bean. that is, more than 20 @EJB should be declared
> for a class. This is not readable and also very bad-styled.
> Why not this local-ref name define in @Stateless annotation as an attribute
> say "refName" so each session bean has declared its own local reference name
> and we can lookup them any where in application locally
> -----
> --
> Regards
> Mohammad Norouzi
> Help each other to reach the future faster
> Pixelshot Photoblog
> Brainable Blog
> --
> View this message in context:
> Sent from the OpenEJB User mailing list archive at

- Mohammad Nour
- LinkedIn:
"Life is like riding a bicycle. To keep your balance you must keep moving"
- Albert Einstein

View raw message