From: Nicolas De Loof Date: Tue, 26 Feb 2008 16:52:49 +0000 (+0000) Subject: plexus lifecycle handling moved to a BeanPostProcessor X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=263e57398c60d84177d011d859de177d35d013ad;p=archiva.git plexus lifecycle handling moved to a BeanPostProcessor BeanPostProcessor and PlexusContainerAdapter automatically registered in the ApplicationContext fall back to ConsoleLoggerManager when no LoggerManager bean found =========================================================== !!! archiva-proxy tests now pass as PlexusInSpringTests !!! =========================================================== git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches@631290 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/CachedFailuresPolicyTest-context.xml b/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/CachedFailuresPolicyTest-context.xml index 6b9cb384c..840223b1a 100644 --- a/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/CachedFailuresPolicyTest-context.xml +++ b/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/CachedFailuresPolicyTest-context.xml @@ -4,11 +4,6 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> - - - - diff --git a/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ChecksumPolicyTest-context.xml b/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ChecksumPolicyTest-context.xml deleted file mode 100644 index 5add86ce6..000000000 --- a/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ChecksumPolicyTest-context.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ReleasePolicyTest-context.xml b/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ReleasePolicyTest-context.xml deleted file mode 100644 index 5add86ce6..000000000 --- a/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ReleasePolicyTest-context.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/SnapshotsPolicyTest-context.xml b/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/SnapshotsPolicyTest-context.xml deleted file mode 100644 index 5add86ce6..000000000 --- a/springy/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/SnapshotsPolicyTest-context.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ChecksumTransferTest.xml b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ChecksumTransferTest.xml index efc12cd52..19ca39096 100644 --- a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ChecksumTransferTest.xml +++ b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ChecksumTransferTest.xml @@ -72,17 +72,17 @@ org.apache.maven.archiva.policies.PostDownloadPolicy postDownloadPolicies - - org.apache.maven.archiva.common.spring.SpringFactory - default - org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers consumers + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + - + org.codehaus.plexus.cache.Cache url-failures-cache @@ -103,7 +103,7 @@ 1800 - + org.codehaus.plexus.logging.LoggerManager org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager diff --git a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.xml b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.xml index efc12cd52..19ca39096 100644 --- a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.xml +++ b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.xml @@ -72,17 +72,17 @@ org.apache.maven.archiva.policies.PostDownloadPolicy postDownloadPolicies - - org.apache.maven.archiva.common.spring.SpringFactory - default - org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers consumers + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + - + org.codehaus.plexus.cache.Cache url-failures-cache @@ -103,7 +103,7 @@ 1800 - + org.codehaus.plexus.logging.LoggerManager org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager diff --git a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.xml b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.xml index efc12cd52..19ca39096 100644 --- a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.xml +++ b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.xml @@ -72,17 +72,17 @@ org.apache.maven.archiva.policies.PostDownloadPolicy postDownloadPolicies - - org.apache.maven.archiva.common.spring.SpringFactory - default - org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers consumers + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + - + org.codehaus.plexus.cache.Cache url-failures-cache @@ -103,7 +103,7 @@ 1800 - + org.codehaus.plexus.logging.LoggerManager org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager diff --git a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/MetadataTransferTest.xml b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/MetadataTransferTest.xml index d9611461e..80572a87f 100644 --- a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/MetadataTransferTest.xml +++ b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/MetadataTransferTest.xml @@ -42,8 +42,8 @@ - - + + org.apache.maven.archiva.repository.metadata.MetadataTools org.apache.maven.archiva.repository.metadata.MetadataTools @@ -64,7 +64,7 @@ - + org.apache.maven.archiva.proxy.RepositoryProxyConnectors default @@ -95,17 +95,17 @@ org.apache.maven.archiva.policies.PostDownloadPolicy postDownloadPolicies - - org.apache.maven.archiva.common.spring.SpringFactory - default - org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers consumers + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + - + org.codehaus.plexus.cache.Cache url-failures-cache @@ -126,7 +126,7 @@ 1800 - + org.codehaus.plexus.logging.LoggerManager org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager diff --git a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/RelocateTransferTest.xml b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/RelocateTransferTest.xml index efc12cd52..19ca39096 100644 --- a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/RelocateTransferTest.xml +++ b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/RelocateTransferTest.xml @@ -72,17 +72,17 @@ org.apache.maven.archiva.policies.PostDownloadPolicy postDownloadPolicies - - org.apache.maven.archiva.common.spring.SpringFactory - default - org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers consumers + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + - + org.codehaus.plexus.cache.Cache url-failures-cache @@ -103,7 +103,7 @@ 1800 - + org.codehaus.plexus.logging.LoggerManager org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager diff --git a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/SnapshotTransferTest.xml b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/SnapshotTransferTest.xml index efc12cd52..19ca39096 100644 --- a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/SnapshotTransferTest.xml +++ b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/SnapshotTransferTest.xml @@ -72,17 +72,17 @@ org.apache.maven.archiva.policies.PostDownloadPolicy postDownloadPolicies - - org.apache.maven.archiva.common.spring.SpringFactory - default - org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers consumers + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + - + org.codehaus.plexus.cache.Cache url-failures-cache @@ -103,7 +103,7 @@ 1800 - + org.codehaus.plexus.logging.LoggerManager org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager diff --git a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/spring-context.xml b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/spring-context.xml index aca03f14b..98fcd7fa1 100644 --- a/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/spring-context.xml +++ b/springy/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/spring-context.xml @@ -4,10 +4,6 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> - - - - diff --git a/springy/plexus-spring/pom.xml b/springy/plexus-spring/pom.xml index 24fc7b342..876d29980 100644 --- a/springy/plexus-spring/pom.xml +++ b/springy/plexus-spring/pom.xml @@ -42,6 +42,12 @@ plexus-component-api 1.0-alpha-22 + + + org.codehaus.plexus + plexus-container-default + 1.0-alpha-22 + dom4j diff --git a/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusClassPathXmlApplicationContext.java b/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusClassPathXmlApplicationContext.java index a8d7cb34f..96acdb8e2 100644 --- a/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusClassPathXmlApplicationContext.java +++ b/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusClassPathXmlApplicationContext.java @@ -22,6 +22,7 @@ package org.codehaus.plexus.spring; import java.io.IOException; import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -98,4 +99,19 @@ public class PlexusClassPathXmlApplicationContext super.loadBeanDefinitions( reader ); } + /** + * {@inheritDoc} + * @see org.springframework.context.support.AbstractApplicationContext#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory) + */ + protected void postProcessBeanFactory( ConfigurableListableBeanFactory beanFactory ) + { + PlexusContainerAdapter plexus = new PlexusContainerAdapter(); + plexus.setApplicationContext( this ); + beanFactory.registerSingleton( "plexusContainer", plexus ); + + PlexusLifecycleBeanPostProcessor lifecycle = new PlexusLifecycleBeanPostProcessor(); + lifecycle.setBeanFactory( this ); + beanFactory.addBeanPostProcessor( lifecycle ); + } + } diff --git a/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusComponentFactoryBean.java b/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusComponentFactoryBean.java index afbe81cc5..636c78ad1 100644 --- a/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusComponentFactoryBean.java +++ b/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusComponentFactoryBean.java @@ -88,7 +88,7 @@ public class PlexusComponentFactoryBean private Class implementation; /** The plexus component instantiation strategy */ - private String instantiationStrategy = SINGLETON; + private String instantiationStrategy; /** The plexus component requirements and configurations */ private Map requirements; @@ -96,12 +96,6 @@ public class PlexusComponentFactoryBean /** The plexus component created by this FactoryBean */ private List instances = new LinkedList(); - /** Optional plexus loggerManager */ - private static LoggerManager loggerManager; - - /** Optional plexus context */ - private static Context context; - /** * {@inheritDoc} * @@ -114,10 +108,11 @@ public class PlexusComponentFactoryBean { for ( Iterator iterator = instances.iterator(); iterator.hasNext(); ) { - Object isntance = iterator.next(); - if ( isntance instanceof Disposable ) + Object instance = iterator.next(); + if ( instance instanceof Disposable ) { - ( (Disposable) isntance ).dispose(); + logger.trace( "Dispose plexus bean " + role ); + ( (Disposable) instance ).dispose(); } } } @@ -125,14 +120,22 @@ public class PlexusComponentFactoryBean /** * {@inheritDoc} + * * @see org.springframework.beans.factory.FactoryBean#getObject() */ public Object getObject() throws Exception { - if ( isSingleton() && !instances.isEmpty()) + if ( isSingleton() ) { - return instances.get( 0 ); + synchronized ( instances ) + { + if ( !instances.isEmpty() ) + { + return instances.get( 0 ); + } + return createInstance(); + } } return createInstance(); } @@ -197,22 +200,19 @@ public class PlexusComponentFactoryBean } } } - - handlePlexusLifecycle( component ); - return component; } private Field findField( String fieldName ) { Class clazz = implementation; - while (clazz != Object.class) + while ( clazz != Object.class ) { try { return clazz.getDeclaredField( fieldName ); } - catch (NoSuchFieldException e) + catch ( NoSuchFieldException e ) { clazz = clazz.getSuperclass(); } @@ -222,28 +222,6 @@ public class PlexusComponentFactoryBean throw new BeanInitializationException( error ); } - private void handlePlexusLifecycle( final Object component ) - throws ContextException, InitializationException - { - if ( component instanceof LogEnabled ) - { - ( (LogEnabled) component ).enableLogging( getLoggerManager().getLoggerForComponent( role.getName() ) ); - } - - if ( component instanceof Contextualizable ) - { - // VERRY limited support for Contextualizable - ( (Contextualizable) component ).contextualize( getContext() ); - } - - // TODO add support for Startable, Stopable -> LifeCycle ? - - if ( component instanceof Initializable ) - { - ( (Initializable) component ).initialize(); - } - } - /** * Resolve the requirement that this field exposes in the component * @@ -288,19 +266,6 @@ public class PlexusComponentFactoryBean return SINGLETON.equals( instantiationStrategy ); } - /** - * @return - */ - protected Context getContext() - { - if ( context == null ) - { - PlexusContainer container = (PlexusContainer) beanFactory.getBean( "plexusContainer" ); - context = container.getContext(); - } - return context; - } - protected TypeConverter getBeanTypeConverter() { if ( beanFactory instanceof ConfigurableBeanFactory ) @@ -313,35 +278,6 @@ public class PlexusComponentFactoryBean } } - /** - * Retrieve the loggerManager instance to be used for LogEnabled components - * - * @return - */ - protected LoggerManager getLoggerManager() - { - if ( loggerManager == null ) - { - if ( beanFactory.containsBean( "loggerManager" ) ) - { - loggerManager = (LoggerManager) beanFactory.getBean( "loggerManager" ); - } - else - { - Map loggers = getListableBeanFactory().getBeansOfType( LoggerManager.class ); - if ( loggers.size() == 1 ) - { - loggerManager = (LoggerManager) loggers.values().iterator().next(); - } - } - } - if ( loggerManager == null ) - { - throw new BeanCreationException( "A LoggerManager instance must be set in the applicationContext" ); - } - return loggerManager; - } - private ListableBeanFactory getListableBeanFactory() { if ( beanFactory instanceof ListableBeanFactory ) @@ -351,14 +287,6 @@ public class PlexusComponentFactoryBean throw new BeanInitializationException( "A ListableBeanFactory is required by the PlexusComponentFactoryBean" ); } - /** - * @param loggerManager the loggerManager to set - */ - public void setLoggerManager( LoggerManager loggerManager ) - { - PlexusComponentFactoryBean.loggerManager = loggerManager; - } - /** * @param role the role to set */ @@ -399,11 +327,6 @@ public class PlexusComponentFactoryBean this.requirements = requirements; } - public void setContext( Context context ) - { - PlexusComponentFactoryBean.context = context; - } - public void setBeanFactory( BeanFactory beanFactory ) { this.beanFactory = beanFactory; diff --git a/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusContainerAdapter.java b/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusContainerAdapter.java index 7f45c444d..e0fe3d2ec 100644 --- a/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusContainerAdapter.java +++ b/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusContainerAdapter.java @@ -55,6 +55,11 @@ public class PlexusContainerAdapter private ApplicationContext applicationContext; + public PlexusContainerAdapter() + { + super(); + } + /** * {@inheritDoc} * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() diff --git a/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusLifecycleBeanPostProcessor.java b/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusLifecycleBeanPostProcessor.java new file mode 100644 index 000000000..a1c471446 --- /dev/null +++ b/springy/plexus-spring/src/main/java/org/codehaus/plexus/spring/PlexusLifecycleBeanPostProcessor.java @@ -0,0 +1,159 @@ +package org.codehaus.plexus.spring; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.Map; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.context.Context; +import org.codehaus.plexus.context.ContextException; +import org.codehaus.plexus.logging.LogEnabled; +import org.codehaus.plexus.logging.LoggerManager; +import org.codehaus.plexus.logging.console.ConsoleLoggerManager; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.BeanFactoryAware; +import org.springframework.beans.factory.BeanInitializationException; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.beans.factory.config.BeanPostProcessor; + +/** + * @author Nicolas De Loof + */ +public class PlexusLifecycleBeanPostProcessor + implements BeanPostProcessor, BeanFactoryAware +{ + /** Logger available to subclasses */ + protected final Log logger = LogFactory.getLog( getClass() ); + + private BeanFactory beanFactory; + + private Context context; + + private LoggerManager loggerManager; + + protected Context getContext() + { + if ( context == null ) + { + PlexusContainer container = (PlexusContainer) beanFactory.getBean( "plexusContainer" ); + context = container.getContext(); + } + return context; + } + + /** + * Retrieve the loggerManager instance to be used for LogEnabled components + * + * @return + */ + protected LoggerManager getLoggerManager() + { + if ( loggerManager == null ) + { + if ( beanFactory.containsBean( "loggerManager" ) ) + { + loggerManager = (LoggerManager) beanFactory.getBean( "loggerManager" ); + } + else + { + logger.warn( "No loggerManager set in context. Falling back to ConsoleLoggerManager" ); + ConsoleLoggerManager defaultLoggerManager = new ConsoleLoggerManager(); + defaultLoggerManager.initialize(); + loggerManager = defaultLoggerManager; + } + } + return loggerManager; + } + + /** + * {@inheritDoc} + * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String) + */ + public Object postProcessBeforeInitialization( Object bean, String beanName ) + throws BeansException + { + return bean; + } + + + /** + * {@inheritDoc} + * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String) + */ + public Object postProcessAfterInitialization( Object bean, String beanName ) + throws BeansException + { + if ( bean instanceof FactoryBean ) + { + // only apply to beans + return bean; + } + + if ( bean instanceof LogEnabled ) + { + logger.trace( "Enable Logging on plexus bean " + beanName ); + ( (LogEnabled) bean ).enableLogging( getLoggerManager().getLoggerForComponent( beanName ) ); + } + + if ( bean instanceof Contextualizable ) + { + try + { + logger.trace( "Contextualize plexus bean " + beanName ); + ( (Contextualizable) bean ).contextualize( getContext() ); + } + catch ( ContextException e ) + { + throw new BeanInitializationException( + "Failed to invoke plexus lifecycle Contextualizable.contextualize on " + beanName, e ); + } + } + + // TODO add support for Startable, Stopable -> LifeCycle ? + + if ( bean instanceof Initializable ) + { + try + { + logger.trace( "Initialize plexus bean " + beanName ); + ( (Initializable) bean ).initialize(); + } + catch ( InitializationException e ) + { + throw new BeanInitializationException( "Failed to invoke plexus lifecycle Initializable.initialize on " + beanName, e ); + } + } + return bean; + } + + public void setBeanFactory( BeanFactory beanFactory ) + { + this.beanFactory = beanFactory; + } + + +}