BeanDefinitionRegistry registry = parserContext.getRegistry();
//Definition of the FS Directory
RootBeanDefinition fsDirectoryBeanDefinition = new RootBeanDefinition(
FSDirectoryFactoryBean.class);
fsDirectoryBeanDefinition.setPropertyValues(new MutablePropertyValues());
fsDirectoryBeanDefinition.getPropertyValues()
.addPropertyValue(LOCATION_ATTRIBUTE, location);
registry.registerBeanDefinition(FS_DIRECTORY_ID_PREFIX + id, fsDirectoryBeanDefinition);
//Definition of the index factory
RootBeanDefinition simpleIndexFactoryBeanDefinition = new RootBeanDefinition(
SimpleIndexFactoryBean.class);
simpleIndexFactoryBeanDefinition.setPropertyValues(new MutablePropertyValues());
simpleIndexFactoryBeanDefinition.getPropertyValues()
.addPropertyValue(DIRECTORY_ATTRIBUTE, new RuntimeBeanReference(FS_DIRECTORY_ID_PREFIX + id));
simpleIndexFactoryBeanDefinition.getPropertyValues()
.addPropertyValue(CREATE_ATTRIBUTE, new Boolean(create));