[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Bean instantiate order with contextual injection

alesj do-not-reply at jboss.com
Thu Aug 17 08:56:12 EDT 2006


Another issue:


  |    <bean name="testObject5" class="org.jboss.test.kernel.inject.support.PropertyInjectTestObject">
  |       <property name="map">
  |          <map>
  |             <entry >
  |                <key>test</key>
  |                <value class="org.jboss.test.kernel.inject.support.TesterInterface"><inject/></value>
  |             </entry>
  |          </map>
  |       </property>
  |    </bean>
  | 
  |    public Class getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable
  |    {
  |       // where did I come from ... key or value
  |       for(MetaDataVisitorNode key : keySet())
  |       {
  |          if (previous.equals(key) && keyType != null)
  |          {
  |             return getClass(visitor, keyType);
  |          }
  |       }
  |       for(MetaDataVisitorNode v : values())
  |       {
  |          if (previous.equals(v) && valueType != null)
  |          {
  |             return getClass(visitor, valueType);
  |          }
  |       }
  |       return super.getType(visitor, this);
  |    }
  | 
  | 

But the thing is that MD values seem to get cloned ... so we never actually get equality.

In that Constructor factory + inject problem we should probably set dependency item's whenRequired to earlier state ... will that do it?

Ok, off to the sea. :-)

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

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



More information about the jboss-dev-forums mailing list