4 Replies Latest reply on Oct 18, 2006 10:31 AM by alesj

    New feature proposal: Add injection interceptor scoped defau

    c.vidal

      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