Community

Is there auto-injection going on?

created by David Bosschaert in JBoss Microcontainer - View the full discussion

Looking at the Spring demo in the User's Guide examples I can see that it references the mcBean and gets injected by it. However the mcBean itself doesn't explicitly reference the SimpleBean...

 

<bean id="testBean" class="org.jboss.example.microcontainer.spring.SimpleBean">    
   <!-- other stuff -->
   <property name="refBean"><ref bean="mcBean"></ref></property></bean>

<bean xmlns="urn:jboss:bean-deployer:2.0" name="mcBean" class="org.jboss.example.microcontainer.spring.MCBean"></bean>

 

 

however, the MCBean still gets injected by the SimpleBean through the setSimpleBean() method

 

public class MCBean
{
   public void setSimpleBean(SimpleBean simpleBean)
   {
      System.out.println("Setting simple bean: " + simpleBean);
   }
}

 

Is there some auto-injection going on or am I missing the declaration for it somewhere?

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer at Community