You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by is_maximum <mn...@gmail.com> on 2009/09/13 06:01:19 UTC

suggestion for defining local ref name for session beans

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.


Re: suggestion for defining local ref name for session beans

Posted by is_maximum <mn...@gmail.com>.


David Blevins wrote:
> 
> 
> Grab the EJB 3.1 PDF2 (the most recent one from march) and check out  
> section "4.4 Global JNDI Access"  It basically describes the standard  
> naming format that is being added for each bean.  It's a little  
> verbose for most cases, but it will at least be a standard way to  
> locate any bean without having to declare a reference on it.
> 
> Is that more or less what you are looking for?
> 
> 

David
Yes that is exactly what I want. Thanks

-----
--
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-tp25420391p25530077.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: suggestion for defining local ref name for session beans

Posted by David Blevins <da...@visi.com>.
Hi Mohammad,

Right, the mappedName attribute is vendor specific.  Our support  
matches that of GlassFish but does have some additional capabilities.

Grab the EJB 3.1 PDF2 (the most recent one from march) and check out  
section "4.4 Global JNDI Access"  It basically describes the standard  
naming format that is being added for each bean.  It's a little  
verbose for most cases, but it will at least be a standard way to  
locate any bean without having to declare a reference on it.

Is that more or less what you are looking for?


We don't implement it yet, but an openejb.jndiname.format like so get  
you close:

  global/{moduleId}/{ejbName}/{interfaceClass}


-David

On Sep 14, 2009, at 11:01 PM, is_maximum wrote:


>
> Hey John,
>
> According to below link,unfortunately mappedName is not portable and  
> it is
> dependent on vendors to support
>
> http://www.ermalaev.spb.ru/javaee/5/docs/api/javax/ejb/Stateless.html
>
> mappedName
> public abstract String mappedName
>
> A product specific name(e.g. global JNDI name) that this session  
> bean should
> be mapped to. Application servers are not required to support any  
> particular
> form or type of mapped name, nor the ability to use mapped names.  
> The mapped
> name is product-dependent and often installation-dependent. No use  
> of a
> mapped name is portable.
>
> Default: ""
>
>
>
> meetoblivion wrote:
>>
>> Mohammad,
>>
>> What I believe we were both referring to is the case of:
>>
>> @Stateless(mappedName="ejb/somePath")
>> public class MyEJB implements MyEJBService {
>> // methods...
>> }
>>
>> And then from your other class..
>>
>> ejbContext.lookup("ejb/somePath")
>>
>> or
>>
>> ic.lookup("ejb/somePath")
>>
>> You're guaranteed to get the EJB mapped to that name.  The app server
>> cannot
>> ignore the mappedName on the Stateless/Stateful annotation.  It may  
>> also
>> put
>> it in other places, but you're guaranteed to get it mapped there.
>>
>> - John
>>
>> -----Original Message-----
>> From: is_maximum [mailto:mnrz57@gmail.com]
>> Sent: Sunday, September 13, 2009 3:25 PM
>> To: users@openejb.apache.org
>> Subject: Re: suggestion for defining local ref name for session beans
>>
>>
>>
>>
>> Quintin Beukes-2 wrote:
>>>
>>> Yes, you can create a mapped name when defining each EJB (part of  
>>> the
>>> @Stateless annotation), and then inside the facade session bean you
>>> can lookup the others doing something like this:
>>>
>>> InitialContext ctx = new InitialContext();
>>> Object lookedUpEJB = ctx.lookup(otherEjbsMappedName);
>>>
>>> Then lookedUpEJB will contain a reference to the EJB. you can wrap
>>> this in a static method of either the facade bean or some other  
>>> class.
>>> When initializing an InitialContext without constructor arguments,  
>>> it
>>> is for the local server by default, and therefore you can lookup any
>>> EJBs in the server.
>>>
>>> Also, if you don't explicitly define a mapped name for the EJB, it
>>> will default to ${beanImplementationClass}Local. So if you have the
>>> following:
>>>
>>> @Stateless
>>> public class MyBean implements MyLocal {}
>>> @Local
>>> public class MyLocal {}
>>>
>>> Then you can do the following to get a reference:
>>> private Object lookup(String name) throws NamingException {
>>>  return new InitialContext().lookup(name);
>>> }
>>>
>>> MyLocal bean = lookup("MyBeanLocal");
>>>
>>> Hope this helps,
>>>
>>>
>>
>>
>> Well thanks, But as far as I can remember, in EJB spec it is said  
>> not to
>> use
>> "mappedName" because still it depends on the provider (or maybe  
>> container)
>> that how to retrieve that name and in some container it might be  
>> ignored!!
>> but using the @EJBs it is ensured that you still can lookup your  
>> local
>> interfaces
>>
>> And the naming style you stated "MyLocalBeanLocal" is defined for  
>> OpenEJB.
>> We are using OpenEJB in running our test cases but in application  
>> server
>> it
>> is not the case.
>>
>> The purpose of this post is that I hope the EJB 3.1 get improved  
>> through
>> David. I know if this is the correct he will try to add such feature.
>>
>> Thank you all guys
>>
>> -----
>> --
>> 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-bea
>> ns-tp25420391p25426273.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
>>
>>
>
>
> -----
> --
> 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-tp25420391p25448431.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>


RE: suggestion for defining local ref name for session beans

Posted by is_maximum <mn...@gmail.com>.
Hey John,

According to below link,unfortunately mappedName is not portable and it is
dependent on vendors to support

http://www.ermalaev.spb.ru/javaee/5/docs/api/javax/ejb/Stateless.html

mappedName
public abstract String mappedName

A product specific name(e.g. global JNDI name) that this session bean should
be mapped to. Application servers are not required to support any particular
form or type of mapped name, nor the ability to use mapped names. The mapped
name is product-dependent and often installation-dependent. No use of a
mapped name is portable. 

Default: "" 



meetoblivion wrote:
> 
> Mohammad,
> 
> What I believe we were both referring to is the case of:
> 
> @Stateless(mappedName="ejb/somePath")
> public class MyEJB implements MyEJBService {
>  // methods...
> }
> 
> And then from your other class..
> 
> ejbContext.lookup("ejb/somePath")
> 
> or
> 
> ic.lookup("ejb/somePath")
> 
> You're guaranteed to get the EJB mapped to that name.  The app server
> cannot
> ignore the mappedName on the Stateless/Stateful annotation.  It may also
> put
> it in other places, but you're guaranteed to get it mapped there.
> 
> - John
> 
> -----Original Message-----
> From: is_maximum [mailto:mnrz57@gmail.com] 
> Sent: Sunday, September 13, 2009 3:25 PM
> To: users@openejb.apache.org
> Subject: Re: suggestion for defining local ref name for session beans
> 
> 
> 
> 
> Quintin Beukes-2 wrote:
>> 
>> Yes, you can create a mapped name when defining each EJB (part of the
>> @Stateless annotation), and then inside the facade session bean you
>> can lookup the others doing something like this:
>> 
>> InitialContext ctx = new InitialContext();
>> Object lookedUpEJB = ctx.lookup(otherEjbsMappedName);
>> 
>> Then lookedUpEJB will contain a reference to the EJB. you can wrap
>> this in a static method of either the facade bean or some other class.
>> When initializing an InitialContext without constructor arguments, it
>> is for the local server by default, and therefore you can lookup any
>> EJBs in the server.
>> 
>> Also, if you don't explicitly define a mapped name for the EJB, it
>> will default to ${beanImplementationClass}Local. So if you have the
>> following:
>> 
>> @Stateless
>> public class MyBean implements MyLocal {}
>> @Local
>> public class MyLocal {}
>> 
>> Then you can do the following to get a reference:
>> private Object lookup(String name) throws NamingException {
>>   return new InitialContext().lookup(name);
>> }
>> 
>> MyLocal bean = lookup("MyBeanLocal");
>> 
>> Hope this helps,
>> 
>> 
> 
> 
> Well thanks, But as far as I can remember, in EJB spec it is said not to
> use
> "mappedName" because still it depends on the provider (or maybe container)
> that how to retrieve that name and in some container it might be ignored!!
> but using the @EJBs it is ensured that you still can lookup your local
> interfaces
> 
> And the naming style you stated "MyLocalBeanLocal" is defined for OpenEJB.
> We are using OpenEJB in running our test cases but in application server
> it
> is not the case. 
> 
> The purpose of this post is that I hope the EJB 3.1 get improved through
> David. I know if this is the correct he will try to add such feature.
> 
> Thank you all guys
> 
> -----
> --
> 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-bea
> ns-tp25420391p25426273.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
> 
> 
> 
> 


-----
--
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-tp25420391p25448431.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


RE: suggestion for defining local ref name for session beans

Posted by is_maximum <mn...@gmail.com>.
Well thanks meetoblivion, I will try it and inform you the result


meetoblivion wrote:
> 
> Mohammad,
> 
> What I believe we were both referring to is the case of:
> 
> @Stateless(mappedName="ejb/somePath")
> public class MyEJB implements MyEJBService {
>  // methods...
> }
> 
> And then from your other class..
> 
> ejbContext.lookup("ejb/somePath")
> 
> or
> 
> ic.lookup("ejb/somePath")
> 
> You're guaranteed to get the EJB mapped to that name.  The app server
> cannot
> ignore the mappedName on the Stateless/Stateful annotation.  It may also
> put
> it in other places, but you're guaranteed to get it mapped there.
> 
> - John
> 


-----
--
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-tp25420391p25440684.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


RE: suggestion for defining local ref name for session beans

Posted by "John D. Ament" <my...@gmail.com>.
Mohammad,

What I believe we were both referring to is the case of:

@Stateless(mappedName="ejb/somePath")
public class MyEJB implements MyEJBService {
 // methods...
}

And then from your other class..

ejbContext.lookup("ejb/somePath")

or

ic.lookup("ejb/somePath")

You're guaranteed to get the EJB mapped to that name.  The app server cannot
ignore the mappedName on the Stateless/Stateful annotation.  It may also put
it in other places, but you're guaranteed to get it mapped there.

- John

-----Original Message-----
From: is_maximum [mailto:mnrz57@gmail.com] 
Sent: Sunday, September 13, 2009 3:25 PM
To: users@openejb.apache.org
Subject: Re: suggestion for defining local ref name for session beans




Quintin Beukes-2 wrote:
> 
> Yes, you can create a mapped name when defining each EJB (part of the
> @Stateless annotation), and then inside the facade session bean you
> can lookup the others doing something like this:
> 
> InitialContext ctx = new InitialContext();
> Object lookedUpEJB = ctx.lookup(otherEjbsMappedName);
> 
> Then lookedUpEJB will contain a reference to the EJB. you can wrap
> this in a static method of either the facade bean or some other class.
> When initializing an InitialContext without constructor arguments, it
> is for the local server by default, and therefore you can lookup any
> EJBs in the server.
> 
> Also, if you don't explicitly define a mapped name for the EJB, it
> will default to ${beanImplementationClass}Local. So if you have the
> following:
> 
> @Stateless
> public class MyBean implements MyLocal {}
> @Local
> public class MyLocal {}
> 
> Then you can do the following to get a reference:
> private Object lookup(String name) throws NamingException {
>   return new InitialContext().lookup(name);
> }
> 
> MyLocal bean = lookup("MyBeanLocal");
> 
> Hope this helps,
> 
> 


Well thanks, But as far as I can remember, in EJB spec it is said not to use
"mappedName" because still it depends on the provider (or maybe container)
that how to retrieve that name and in some container it might be ignored!!
but using the @EJBs it is ensured that you still can lookup your local
interfaces

And the naming style you stated "MyLocalBeanLocal" is defined for OpenEJB.
We are using OpenEJB in running our test cases but in application server it
is not the case. 

The purpose of this post is that I hope the EJB 3.1 get improved through
David. I know if this is the correct he will try to add such feature.

Thank you all guys

-----
--
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-bea
ns-tp25420391p25426273.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: suggestion for defining local ref name for session beans

Posted by is_maximum <mn...@gmail.com>.


Quintin Beukes-2 wrote:
> 
> Yes, you can create a mapped name when defining each EJB (part of the
> @Stateless annotation), and then inside the facade session bean you
> can lookup the others doing something like this:
> 
> InitialContext ctx = new InitialContext();
> Object lookedUpEJB = ctx.lookup(otherEjbsMappedName);
> 
> Then lookedUpEJB will contain a reference to the EJB. you can wrap
> this in a static method of either the facade bean or some other class.
> When initializing an InitialContext without constructor arguments, it
> is for the local server by default, and therefore you can lookup any
> EJBs in the server.
> 
> Also, if you don't explicitly define a mapped name for the EJB, it
> will default to ${beanImplementationClass}Local. So if you have the
> following:
> 
> @Stateless
> public class MyBean implements MyLocal {}
> @Local
> public class MyLocal {}
> 
> Then you can do the following to get a reference:
> private Object lookup(String name) throws NamingException {
>   return new InitialContext().lookup(name);
> }
> 
> MyLocal bean = lookup("MyBeanLocal");
> 
> Hope this helps,
> 
> 


Well thanks, But as far as I can remember, in EJB spec it is said not to use
"mappedName" because still it depends on the provider (or maybe container)
that how to retrieve that name and in some container it might be ignored!!
but using the @EJBs it is ensured that you still can lookup your local
interfaces

And the naming style you stated "MyLocalBeanLocal" is defined for OpenEJB.
We are using OpenEJB in running our test cases but in application server it
is not the case. 

The purpose of this post is that I hope the EJB 3.1 get improved through
David. I know if this is the correct he will try to add such feature.

Thank you all guys

-----
--
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-tp25420391p25426273.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: suggestion for defining local ref name for session beans

Posted by Quintin Beukes <qu...@skywalk.co.za>.
Yes, you can create a mapped name when defining each EJB (part of the
@Stateless annotation), and then inside the facade session bean you
can lookup the others doing something like this:

InitialContext ctx = new InitialContext();
Object lookedUpEJB = ctx.lookup(otherEjbsMappedName);

Then lookedUpEJB will contain a reference to the EJB. you can wrap
this in a static method of either the facade bean or some other class.
When initializing an InitialContext without constructor arguments, it
is for the local server by default, and therefore you can lookup any
EJBs in the server.

Also, if you don't explicitly define a mapped name for the EJB, it
will default to ${beanImplementationClass}Local. So if you have the
following:

@Stateless
public class MyBean implements MyLocal {}
@Local
public class MyLocal {}

Then you can do the following to get a reference:
private Object lookup(String name) throws NamingException {
  return new InitialContext().lookup(name);
}

MyLocal bean = lookup("MyBeanLocal");

Hope this helps,
Q

On Sun, Sep 13, 2009 at 11:19 AM, John Ament <my...@gmail.com> wrote:
> 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.mohammad@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 <mn...@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
>>
>



-- 
Quintin Beukes

Re: suggestion for defining local ref name for session beans

Posted by John Ament <my...@gmail.com>.
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.mohammad@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 <mn...@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
>

Re: suggestion for defining local ref name for session beans

Posted by is_maximum <mn...@gmail.com>.


mnour 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.
> 

Sorry, you didn't get the point. In a POJO class how could you inject using
@EJB? and using Context.lookup() you still need a JNDI name to lookup local
interfaces, this name is declared by @EJBs and @EJB on the class (not the
field)



-----
--
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-tp25420391p25426228.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: suggestion for defining local ref name for session beans

Posted by Mohammad Nour El-Din <no...@gmail.com>.
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 <mn...@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