I'm not sure, could be that I'm missing the the subtlety of your request,
but isn't this what the mappedName attribute is for on the
Stateless/Stateful annotation?

- John

On Sun, Sep 13, 2009 at 4:20 AM, Mohammad Nour El-Din <
nour.moham...@gmail.com> wrote:

> 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 <mnr...@gmail.com> 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
> >
> > http://pixelshot.wordpress.com Pixelshot Photoblog
> >
> > http://brainable.blogspot.com Brainable Blog
> >
> >
> > --
> > View this message in context:
> http://www.nabble.com/suggestion-for-defining-local-ref-name-for-session-beans-tp25420391p25420391.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
> >
>
>
>
> --
> Thanks
> - Mohammad Nour
> - LinkedIn: http://www.linkedin.com/in/mnour
> ----
> "Life is like riding a bicycle. To keep your balance you must keep moving"
> - Albert Einstein
>

Reply via email to