<groupId>org.codehaus.plexus</groupId>\r
<artifactId>plexus-spring</artifactId>\r
<version>1.0-SNAPSHOT</version>\r
+ <name>Plexus to Spring Adapter</name>\r
\r
<description>\r
Bridge utility to use plexus components in a SpringFramework context.\r
\r
/**\r
* A custom ClassPathXmlApplicationContext to support plexus\r
- * <tr>components.xml</tt> descriptors in Spring, with no changes required\r
- * to neither plexus nor spring beans.\r
+ * <tr>components.xml</tt> descriptors in Spring, with no changes required to\r
+ * neither plexus nor spring beans.\r
*\r
* @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>\r
*/\r
public class PlexusClassPathXmlApplicationContext\r
extends ClassPathXmlApplicationContext\r
{\r
+ private PlexusLifecycleBeanPostProcessor lifecycleBeanPostProcessor;\r
+\r
public PlexusClassPathXmlApplicationContext( String path, Class clazz )\r
throws BeansException\r
{\r
\r
/**\r
* {@inheritDoc}\r
+ *\r
* @see org.springframework.context.support.AbstractApplicationContext#postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)\r
*/\r
protected void postProcessBeanFactory( ConfigurableListableBeanFactory beanFactory )\r
plexus.setApplicationContext( this );\r
beanFactory.registerSingleton( "plexusContainer", plexus );\r
\r
- PlexusLifecycleBeanPostProcessor lifecycle = new PlexusLifecycleBeanPostProcessor();\r
- lifecycle.setBeanFactory( this );\r
- beanFactory.addBeanPostProcessor( lifecycle );\r
+ lifecycleBeanPostProcessor = new PlexusLifecycleBeanPostProcessor();\r
+ lifecycleBeanPostProcessor.setBeanFactory( this );\r
+ beanFactory.addBeanPostProcessor( lifecycleBeanPostProcessor );\r
+ }\r
+\r
+ /**\r
+ * {@inheritDoc}\r
+ *\r
+ * @see org.springframework.context.support.AbstractApplicationContext#doClose()\r
+ */\r
+ protected void doClose()\r
+ {\r
+ try\r
+ {\r
+ lifecycleBeanPostProcessor.destroy();\r
+ }\r
+ catch ( Throwable ex )\r
+ {\r
+ logger.error( "Exception thrown from PlexusLifecycleBeanPostProcessor handling ContextClosedEvent", ex );\r
+ }\r
+ super.doClose();\r
}\r
\r
}\r
* @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>\r
*/\r
public class PlexusComponentFactoryBean\r
- implements FactoryBean, BeanFactoryAware, DisposableBean\r
+ implements FactoryBean, BeanFactoryAware\r
{\r
/** Logger available to subclasses */\r
protected final Log logger = LogFactory.getLog( getClass() );\r
/** The plexus component requirements and configurations */\r
private Map requirements;\r
\r
- /** The plexus component created by this FactoryBean */\r
- private List instances = new LinkedList();\r
-\r
- /**\r
- * {@inheritDoc}\r
- *\r
- * @see org.springframework.beans.factory.config.AbstractFactoryBean#destroy()\r
- */\r
- public void destroy()\r
- throws Exception\r
- {\r
- synchronized ( instances )\r
- {\r
- for ( Iterator iterator = instances.iterator(); iterator.hasNext(); )\r
- {\r
- Object instance = iterator.next();\r
- if ( instance instanceof Disposable )\r
- {\r
- logger.trace( "Dispose plexus bean " + role );\r
- ( (Disposable) instance ).dispose();\r
- }\r
- }\r
- }\r
- }\r
+ private Object singletonInstance;\r
\r
/**\r
* {@inheritDoc}\r
{\r
if ( isSingleton() )\r
{\r
- synchronized ( instances )\r
+ synchronized ( this )\r
{\r
- if ( !instances.isEmpty() )\r
+ if ( singletonInstance != null )\r
{\r
- return instances.get( 0 );\r
+ return singletonInstance;\r
}\r
- return createInstance();\r
+ this.singletonInstance = createInstance();\r
+ return singletonInstance;\r
}\r
}\r
return createInstance();\r
{\r
logger.debug( "Creating plexus component " + implementation );\r
final Object component = implementation.newInstance();\r
- synchronized ( instances )\r
- {\r
- instances.add( component );\r
- }\r
if ( requirements != null )\r
{\r
for ( Iterator iterator = requirements.entrySet().iterator(); iterator.hasNext(); )\r
* under the License.
*/
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
import org.apache.commons.logging.Log;
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.Disposable;
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.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
-import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.config.BeanPostProcessor;
/**
* @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
*/
public class PlexusLifecycleBeanPostProcessor
- implements BeanPostProcessor, BeanFactoryAware
+ implements BeanPostProcessor, BeanFactoryAware, DisposableBean
{
/** Logger available to subclasses */
protected final Log logger = LogFactory.getLog( getClass() );
private LoggerManager loggerManager;
+ /** The plexus Disposable components */
+ private Map disposables = new HashMap();
+
protected Context getContext()
{
if ( context == null )
/**
* {@inheritDoc}
- * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
+ *
+ * @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)
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object,
+ * java.lang.String)
*/
public Object postProcessAfterInitialization( Object bean, String beanName )
throws BeansException
}
catch ( InitializationException e )
{
- throw new BeanInitializationException( "Failed to invoke plexus lifecycle Initializable.initialize on " + beanName, e );
+ throw new BeanInitializationException( "Failed to invoke plexus lifecycle Initializable.initialize on "
+ + beanName, e );
+ }
+ }
+
+ if ( bean instanceof Disposable )
+ {
+ synchronized ( disposables )
+ {
+ disposables.put( beanName, bean );
}
}
return bean;
this.beanFactory = beanFactory;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.springframework.beans.factory.config.AbstractFactoryBean#destroy()
+ */
+ public void destroy()
+ throws Exception
+ {
+ synchronized ( disposables )
+ {
+ for ( Iterator iterator = disposables.entrySet().iterator(); iterator.hasNext(); )
+ {
+ Map.Entry entry = (Map.Entry) iterator.next();
+ logger.debug( "Dispose plexus component " + entry.getKey() );
+ ( (Disposable) entry.getValue() ).dispose();
+ }
+ }
+ }
}
--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<project name="Monitoring">
+
+ <bannerRight>
+ <name>Plexus Spring integration support</name>
+ <href>/index.html</href>
+ </bannerRight>
+
+ <body>
+ <menu name="Plexus Spring integration support">
+ <item name="Overview" href="/index.html"/>
+ </menu>
+ <menu name="Links">
+ <item name="Spring framework" href="http://www.springframework.org"/>
+ <item name="Plexus" href="http://plexus.codehaus.org/"/>
+ </menu>
+
+ </body>
+
+</project>
--- /dev/null
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+
+<document>
+
+ <properties>
+ <title>Plexus to Spring Adapter</title>
+ </properties>
+
+ <body>
+
+ <section name="Plexus to Spring Adapter">
+ <subsection name="overview">
+ <p>
+ This library is an adapter to use plexus components in a springframework application context.
+ It translates plexus components descriptors and interfaces to spring to get dependency
+ injection and interface based lifecycle management, with some limitations.
+ </p>
+ </subsection>
+ <subsection name="features">
+ <p>
+ Pexus-spring provides to plexus components :
+ <ul>
+ <li>Lifecycle management (creation, initialization, Logger injection and destruction</li>
+ <li>Limited Contextualization using a PlexusContainerAdapter and ContextAdapter</li>
+ <li>Injection of dependencies (using plexus direct field-injection) based on plexus descriptor</li>
+ <li>Injection of configuration, limited to String and simple types</li>
+ </ul>
+ </p>
+ </subsection>
+ <subsection name="how ?">
+ <p>
+ Pexus-spring defines some custom Spring components :
+ <ul>
+ <li>a <tt>PlexusBeanDefinitionDocumentReader</tt> to translate the plexus component descriptors
+ to spring context XML document (using XSLT)</li>
+ <li>a spring namespace dedicated to plexus, that mimics the plexus component descriptor format</li>
+ <li>a FactoryBean to create and inject dependencies in plexus components</li>
+ <li>a BeanPostProcessor to support plexus lifecycle interfaces in spring context
+ (LogEnabled, Contextualizable, Initializable, Disposable).</li>
+ <li>a <tt>PlexusContainerAdapter</tt> to support plexus-like lookups in spring context</li>
+ </ul>
+ To make life simplier, plexus-spring also provides a <tt>PlexusClassPathXmlApplicationContext</tt>
+ that registers all necessary components and accepts either spring or plexus XML files as context locations.
+ </p>
+ </subsection>
+ <subsection name="who is using it ?">
+ <p>This adapter library has been created as part of the migration effort from plexus to spring
+ in apache Archiva. It allows a smooth migration from plexus to spring as the initial components
+ can be used as is in spring until they are migrated to be more spring compliant or replaced.
+ </p>
+ <p>It can also be used to support some plexus components packaged as jars that provide helpfull
+ features to a spring-based application.
+ </p>
+ </subsection>
+ </section>
+
+ </body>
+
+</document>
package org.codehaus.plexus.spring;\r
\r
+import java.util.List;\r
import java.util.Map;\r
\r
/*\r
\r
/**\r
* A typical plexus component implementation\r
- * \r
+ *\r
* @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>\r
*/\r
public class ComplexPlexusBean\r
*/\r
private Map plexusBeans;\r
\r
+ /**\r
+ * @plexus.requirement role="org.codehaus.plexus.spring.PlexusBean"\r
+ */\r
+ private List beansList;\r
+\r
/**\r
* @see org.codehaus.plexus.spring.PlexusBean#toString()\r
*/\r
{\r
return plexusBeans.size() + " components for role org.codehaus.plexus.spring.PlexusBean";\r
}\r
+\r
+ public Map getBeans()\r
+ {\r
+ return plexusBeans;\r
+ }\r
+\r
+ public List getBeansList()\r
+ {\r
+ return beansList;\r
+ }\r
}\r
+++ /dev/null
-package org.codehaus.plexus.spring;\r
-\r
-/*\r
- * Licensed to the Apache Software Foundation (ASF) under one\r
- * or more contributor license agreements. See the NOTICE file\r
- * distributed with this work for additional information\r
- * regarding copyright ownership. The ASF licenses this file\r
- * to you under the Apache License, Version 2.0 (the\r
- * "License"); you may not use this file except in compliance\r
- * with the License. You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing,\r
- * software distributed under the License is distributed on an\r
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
- * KIND, either express or implied. See the License for the\r
- * specific language governing permissions and limitations\r
- * under the License.\r
- */\r
-\r
-import junit.framework.TestCase;\r
-\r
-import org.springframework.context.ConfigurableApplicationContext;\r
-\r
-public class FieldInjectionTest\r
- extends TestCase\r
-{\r
- /**\r
- * {@inheritDoc}\r
- * @see junit.framework.TestCase#setUp()\r
- */\r
- protected void setUp()\r
- throws Exception\r
- {\r
- System.setProperty( "plexus-spring.debug", "true" );\r
- }\r
-\r
- public void testFieldInjectionInSpringContext()\r
- throws Exception\r
- {\r
- ConfigurableApplicationContext applicationContext = new PlexusClassPathXmlApplicationContext( new String[] { "components.xml", "applicationContext.xml" } );\r
- PlexusBean plexusBean = (PlexusBean) applicationContext.getBean( "plexusBean" );\r
- assertEquals( PlexusBean.INITIALIZED, plexusBean.getState() );\r
- assertEquals( "field injection failed", "expected SpringBean", plexusBean.toString() );\r
- applicationContext.close();\r
- assertEquals( PlexusBean.DISPOSED, plexusBean.getState() );\r
-\r
- }\r
-\r
- public void testInjectMapForRole()\r
- throws Exception\r
- {\r
- ConfigurableApplicationContext applicationContext = new PlexusClassPathXmlApplicationContext( new String[] { "components.xml", "applicationContext.xml" } );\r
- ComplexPlexusBean plexusBean = (ComplexPlexusBean) applicationContext.getBean( "complexPlexusBean" );\r
- assertEquals( "2 components for role org.codehaus.plexus.spring.PlexusBean", plexusBean.toString() );\r
- }\r
-\r
-}\r
package org.codehaus.plexus.spring;\r
\r
+import org.codehaus.plexus.context.Context;\r
+import org.codehaus.plexus.logging.Logger;\r
\r
/*\r
* Licensed to the Apache Software Foundation (ASF) under one\r
\r
/**\r
* A plexus component interface\r
+ *\r
* @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>\r
*/\r
public interface PlexusBean\r
{\r
public static final String DISPOSED = "disposed";\r
+\r
public static final String INITIALIZED = "initialized";\r
+\r
String ROLE = PlexusBean.class.getName();\r
- \r
- String toString();\r
+\r
+ String describe();\r
\r
String getState();\r
\r
+ Context getContext();\r
+\r
+ Logger getLogger();\r
}
\ No newline at end of file
package org.codehaus.plexus.spring;\r
\r
+import org.codehaus.plexus.context.Context;\r
+import org.codehaus.plexus.context.ContextException;\r
import org.codehaus.plexus.logging.AbstractLogEnabled;\r
+import org.codehaus.plexus.logging.Logger;\r
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;\r
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;\r
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;\r
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;\r
*/\r
public class PlexusBeanImpl\r
extends AbstractLogEnabled\r
- implements PlexusBean, Initializable, Disposable\r
+ implements PlexusBean, Initializable, Disposable, Contextualizable\r
{\r
private String message;\r
\r
*/\r
private SpringBean bean;\r
\r
+ private Context context;\r
+\r
public void initialize()\r
throws InitializationException\r
{\r
state = DISPOSED;\r
}\r
\r
- /**\r
- * @see org.codehaus.plexus.spring.PlexusBean#toString()\r
- */\r
- public String toString()\r
+ public String describe()\r
{\r
getLogger().info( "Logger has been set" );\r
return message + " " + bean.toString();\r
return state;\r
}\r
\r
+ /**\r
+ * {@inheritDoc}\r
+ * @see org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable#contextualize(org.codehaus.plexus.context.Context)\r
+ */\r
+ public void contextualize( Context context )\r
+ throws ContextException\r
+ {\r
+ this.context = context;\r
+ }\r
+\r
+ public Context getContext()\r
+ {\r
+ return context;\r
+ }\r
+\r
+ public Logger getLogger()\r
+ {\r
+ return super.getLogger();\r
+ }\r
}\r
--- /dev/null
+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 junit.framework.TestCase;
+
+import org.springframework.context.ConfigurableApplicationContext;
+
+public class PlexusClassPathXmlApplicationContextTest
+ extends TestCase
+{
+ /**
+ * {@inheritDoc}
+ *
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp()
+ throws Exception
+ {
+ System.setProperty( "plexus-spring.debug", "true" );
+ }
+
+ public void testInjectSpringBeansInPlexusComponent()
+ throws Exception
+ {
+ ConfigurableApplicationContext applicationContext =
+ new PlexusClassPathXmlApplicationContext( new String[] {
+ "testInjectSpringBeansInPlexusComponent.xml",
+ "testInjectSpringBeansInPlexusComponent-context.xml" } );
+ PlexusBean plexusBean = (PlexusBean) applicationContext.getBean( "plexusBean" );
+ assertEquals( "field injection failed", "expected SpringBean", plexusBean.describe() );
+ applicationContext.close();
+ }
+
+ public void testPlexusLifecycleSupport()
+ throws Exception
+ {
+ ConfigurableApplicationContext applicationContext =
+ new PlexusClassPathXmlApplicationContext( new String[] {
+ "testPlexusLifecycleSupport.xml" } );
+ PlexusBean plexusBean = (PlexusBean) applicationContext.getBean( "plexusBean" );
+ assertEquals( PlexusBean.INITIALIZED, plexusBean.getState() );
+ assertNotNull( plexusBean.getContext() );
+ assertNotNull( plexusBean.getLogger() );
+ applicationContext.close();
+ assertEquals( PlexusBean.DISPOSED, plexusBean.getState() );
+
+ }
+
+ public void testInjectMapForRole()
+ throws Exception
+ {
+ ConfigurableApplicationContext applicationContext =
+ new PlexusClassPathXmlApplicationContext( new String[] {
+ "testInjectMapForRole.xml",
+ "testInjectMapForRole-context.xml" } );
+ ComplexPlexusBean plexusBean = (ComplexPlexusBean) applicationContext.getBean( "complexPlexusBean" );
+ assertTrue( plexusBean.getBeans().containsKey( "spring" ) );
+ assertTrue( plexusBean.getBeans().containsKey( "plexus" ) );
+ assertEquals( "2 components for role org.codehaus.plexus.spring.PlexusBean", plexusBean.toString() );
+ }
+
+ public void testInjectListForRole()
+ throws Exception
+ {
+ ConfigurableApplicationContext applicationContext =
+ new PlexusClassPathXmlApplicationContext( new String[] {
+ "testInjectListForRole.xml",
+ "testInjectListForRole-context.xml" } );
+ ComplexPlexusBean plexusBean = (ComplexPlexusBean) applicationContext.getBean( "complexPlexusBean" );
+ assertEquals( 2, plexusBean.getBeansList().size() );
+ }
+
+}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
-\r
- <bean id="loggerManager" class="org.codehaus.plexus.logging.console.ConsoleLoggerManager"\r
- init-method="initialize"/>\r
-\r
- <bean id="springBean" class="org.codehaus.plexus.spring.SpringBean"/>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<component-set>\r
- <components>\r
- <component>\r
- <role>org.codehaus.plexus.spring.PlexusBean</role>\r
- <role-hint>default</role-hint>\r
- <implementation>org.codehaus.plexus.spring.PlexusBeanImpl</implementation>\r
- <requirements>\r
- <requirement>\r
- <role>springBean</role>\r
- </requirement>\r
- </requirements>\r
- <configuration>\r
- <message>expected</message>\r
- </configuration>\r
- </component>\r
- <component>\r
- <role>org.codehaus.plexus.spring.PlexusBean</role>\r
- <role-hint>another</role-hint>\r
- <implementation>org.codehaus.plexus.spring.PlexusBeanImpl</implementation>\r
- <requirements>\r
- <requirement>\r
- <field-name>bean</field-name>\r
- <role>springBean</role>\r
- </requirement>\r
- </requirements>\r
- <configuration>\r
- <message>another</message>\r
- </configuration>\r
- </component>\r
- <component>\r
- <role>org.codehaus.plexus.spring.ComplexPlexusBean</role>\r
- <implementation>org.codehaus.plexus.spring.ComplexPlexusBean</implementation>\r
- <requirements>\r
- <requirement>\r
- <field-name>plexusBeans</field-name>\r
- <role>org.codehaus.plexus.spring.PlexusBean</role>\r
- </requirement>\r
- </requirements>\r
- </component>\r
- </components>\r
-</component-set>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="loggerManager" class="org.codehaus.plexus.logging.console.ConsoleLoggerManager"
+ init-method="initialize"/>
+
+ <bean name="plexusBean#spring" class="org.codehaus.plexus.spring.PlexusBeanImpl"/>
+
+</beans>
\ No newline at end of file
--- /dev/null
+<component-set>
+ <components>
+ <component>
+ <role>org.codehaus.plexus.spring.PlexusBean</role>
+ <role-hint>plexus</role-hint>
+ <implementation>org.codehaus.plexus.spring.PlexusBeanImpl</implementation>
+ </component>
+ <component>
+ <role>org.codehaus.plexus.spring.ComplexPlexusBean</role>
+ <implementation>org.codehaus.plexus.spring.ComplexPlexusBean</implementation>
+ <requirements>
+ <requirement>
+ <field-name>beansList</field-name>
+ <role>org.codehaus.plexus.spring.PlexusBean</role>
+ </requirement>
+ </requirements>
+ </component>
+ </components>
+</component-set>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+ <bean id="loggerManager" class="org.codehaus.plexus.logging.console.ConsoleLoggerManager"\r
+ init-method="initialize"/>\r
+\r
+ <bean name="plexusBean#spring" class="org.codehaus.plexus.spring.PlexusBeanImpl"/>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<component-set>\r
+ <components>\r
+ <component>\r
+ <role>org.codehaus.plexus.spring.PlexusBean</role>\r
+ <role-hint>plexus</role-hint>\r
+ <implementation>org.codehaus.plexus.spring.PlexusBeanImpl</implementation>\r
+ </component>\r
+ <component>\r
+ <role>org.codehaus.plexus.spring.ComplexPlexusBean</role>\r
+ <implementation>org.codehaus.plexus.spring.ComplexPlexusBean</implementation>\r
+ <requirements>\r
+ <requirement>\r
+ <field-name>plexusBeans</field-name>\r
+ <role>org.codehaus.plexus.spring.PlexusBean</role>\r
+ </requirement>\r
+ </requirements>\r
+ </component>\r
+ </components>\r
+</component-set>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="loggerManager" class="org.codehaus.plexus.logging.console.ConsoleLoggerManager"
+ init-method="initialize"/>
+
+ <bean id="springBean" class="org.codehaus.plexus.spring.SpringBean"/>
+
+</beans>
\ No newline at end of file
--- /dev/null
+<component-set>
+ <components>
+ <component>
+ <role>org.codehaus.plexus.spring.PlexusBean</role>
+ <role-hint>default</role-hint>
+ <implementation>org.codehaus.plexus.spring.PlexusBeanImpl</implementation>
+ <requirements>
+ <requirement>
+ <!-- implicit field-injection : no field-name set -->
+ <role>springBean</role>
+ </requirement>
+ </requirements>
+ <configuration>
+ <message>expected</message>
+ </configuration>
+ </component>
+ </components>
+</component-set>
--- /dev/null
+<component-set>
+ <components>
+ <component>
+ <role>org.codehaus.plexus.spring.PlexusBean</role>
+ <role-hint>default</role-hint>
+ <implementation>org.codehaus.plexus.spring.PlexusBeanImpl</implementation>
+ </component>
+ </components>
+</component-set>