if ( method.isAnnotationPresent(org.jboss.seam.annotations.Factory.class) )
{
//can't use Init.instance() here because of unit tests
Init init = (Init) applicationContext.get(Seam.getComponentName(Init.class));
String contextVariable = toName( method.getAnnotation(org.jboss.seam.annotations.Factory.class).value(), method );
init.addFactoryMethod(contextVariable, method, this);
if ( method.getAnnotation(org.jboss.seam.annotations.Factory.class).autoCreate() )
{
init.addAutocreateVariable(contextVariable);
}
}