[jboss-user] [JBoss/Spring Integration] - New feature proposal: Add injection interceptor scoped defau

c.vidal do-not-reply at jboss.com
Thu Sep 28 10:41:23 EDT 2006


Today, you have to specify the spring bean factory's JNDI name in each @Spring annotation:
@Spring(jndiName="myApp", bean="SomeBean")
  | private SomeBeanClass pojo;

But most spring based applications use only one bean factory, so it would be very convenient as much as less verbose (I'm lazy ;) ) to be able to specify the default JNDI name of the bean factory in one place. One such place could the SpringInjectionInterceptor. The JNDI name could of course be overriden on a per annotation basis. The default JNDI name could be specified in ejb3-interceptors-aop.xml the following way:

<interceptor class="org.jboss.spring.interceptor.SpringInjectionInterceptor">
  |     <!-- optionnal Spring bean factory default JNDI name -->
  |     <attribute name="defaultJndiName">myApp</attribute>
  | </interceptor>
  | 
  | <bind pointcut="execution(*->new(..))">
  |    <interceptor-ref name="org.jboss.spring.interceptor.SpringInjectionInterceptor"/>
  | </bind>

We then could avoid specifying the jndiName in the annotation:
@Spring(bean="SomeBean")
  | private SomeBeanClass pojo;

What do you think ?

Regards,

Cédric

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974904#3974904

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974904




More information about the jboss-user mailing list