struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Baetz <baetz.paderb...@arcor.de>
Subject Re: Extending EJBInjection interceptor
Date Wed, 27 Aug 2008 20:36:13 GMT
the "old" way for JBoss servers is a JNDI lookup, which looks something 
like this:

InitialContext initialContext = new InitialContext();
service = initialContext.lookup("<myEJB>");

normaly <myEJB> would be the name used in the @stateless  or @statefull 
annotation or (if not set) the classname

As it has been explained to me in current JBoss servers you can inject 
beans by annotating a method or variable with @EJB <beanName> or only 
with @EJB (then the type of the variable/parameter) is used.
But this only works in the servlett context and therefore by using 
Struts ..... I'm out.

Would  the lookup work on other application servers?

Greetings

Struts Two schrieb:
> I am currently using my own customized EJB3InjectInterceptor for Websphere application
server (It only injects local beans as I do not use remote in my application). Now seeing
that Jeromy is working on a new Interceptor, I wonder if all the servers follow the same lookup
pattern. I know that in websphere you can look up a local session bean using:
> ejblocal:<fully qualified class name>
> If the lookup pattern is the same among all the servers then having an interceptor that
does the injection regardless of the server used is a great idea.
> Jeromy Evans schrieb:
>   
>> Alexander Baetz wrote:
>>     
>>> Hi,
>>>
>>> i'm currently working on a new Interceptor for EJB Injection on 
>>> Actions. I allready extendet it to work on fields and methods. But 
>>> since i dont like to make my own Annotation type i wanted to use the 
>>> javax.ejb.ejb anotation. But there is a small problem with that:
>>>
>>> the annotation used by the ejb3-plugin for struts 2 has a field that 
>>> determines if the bean is statefull or stateless. I don't have this 
>>> bean, so how do i determine for the injection if the bean is statefull?
>>>
>>>       
>> I'm not familiar with the plugin, but why does it need to know whether 
>> the bean is statefull or stateless?  I don't think that should affect 
>> the lookup or injection into the action, should it?  Only the 
>> Container that instantiates the bean and provides the instance cares, 
>> doesn't it?
>>     
>
>
>
>       __________________________________________________________________
> Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites.
Download it now at
> http://ca.toolbar.yahoo.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message