title: Spring FactoryBean method with arguments
body: <p>I'm instantiating some beans by XML configuration and instance factory methods:</p>
  
  <pre><code>&lt;bean id="galleryBeanFactory" class="de.tikron.webapp.gallery.bean.XmlGalleryBeanFactory" /&gt;
  
  &lt;bean id="pictureBean" factory-bean="galleryBeanFactory" factory-method="createPictureBean" scope="prototype" /&gt;
  </code></pre>
  
  <p>I instantiate my prototype beans programmatic by BeanFactory.getBean("bean", arguments...):</p>
  
  <pre><code>BeanFactory bf = ContextLoader.getCurrentWebApplicationContext();
  PictureBean pictureBean = (PictureBean) bf.getBean("pictureBean", picture);
  </code></pre>
  
  <p>With Spring 3 I want to change to annotated java-based bean configuration. Here is my FactoryBean:</p>
  
  <pre><code>@Configuration
  public class AnnotatedGalleryBeanFactory implements GalleryBeanFactory
  
    @Bean
    @Scope(BeanDefinition.SCOPE_PROTOTYPE)
    protected PictureBean createPictureBean(Picture picture) {
      PictureBean bean = new PictureBean();
      bean.setPicture(picture);
      return bean;
    }
  }
  </code></pre>
  
  <p>My Question: How can I pass parameters here? The code above results into org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [...model.Picture] found for dependency.</p>