fix javadoc

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches@630147 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nicolas De Loof 2008-02-22 10:37:31 +00:00
parent a70e0c3020
commit 92faaa0853

View File

@ -23,12 +23,23 @@
import java.util.Iterator;
import java.util.Map;
import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.config.AbstractFactoryBean;
/**
* XPathFunction to convert plexus property-name to Spring propertyName.
* A FactoryBean to port to Spring the plexus "get all components with role ..." feature.
* <p>
* Plexus allows to define a requirement this way :
* <pre>
* \/**
* * @plexus.requirement role="org.apache.maven.archiva.policies.PreDownloadPolicy"
* *\/
* private Map<String, PreDownloadPolicy> prePolicies;
* </pre>
* This FactoryBean generates the expected Map from a ListableBeanFactory, based on the role
* to be the FQCN of the component interface.
*
* @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
* @since 1.1
@ -50,6 +61,12 @@ public void afterPropertiesSet()
throws Exception
{
beansOfType = new HashMap<String, Object>();
if ( !( getBeanFactory() instanceof ListableBeanFactory ) )
{
String error = "A ListableBeanFactory bean factory is required to create a bean-of-types Map";
logger.error( error );
throw new BeanInitializationException( error );
}
Map beans = ((ListableBeanFactory) getBeanFactory()).getBeansOfType( type );
for ( Iterator iterator = beans.entrySet().iterator(); iterator.hasNext(); )
{