RE: [picocontainer-dev] XmlContainerBuilder.blues()

Jörg Schaible <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
Hi Paul, 
 
________________________________

	From: Paul Hammant 
	Sent: Friday, May 25, 2007 5:48 PM
	Subject: [picocontainer-dev] XmlContainerBuilder.blues()
	
	
	XMLContainerBuilder can't nest CAFs. It probably has not been able to for some time. 

	See patch - a failing testcase.
________________________________

You did test the wrong thing. The c-a-f tag should not replace the default factory at all! It simply defines a different one that can be used as alternative registering a component.

Real world configuration:

=========== %<============
<?xml version="1.0" encoding="ISO-8859-1" ?>
<container>

	<!-- Create a specialized component adapter factory, that creates a new component for each thread (used for connections) -->
	<component-adapter-factory key="ThreadCAF"
		class="org.picocontainer.gems.adapters.ThreadLocalComponentAdapterFactory">
		<component-adapter-factory class="org.picocontainer.defaults.CachingComponentAdapterFactory">
			<component-adapter-factory class="org.picocontainer.defaults.ConstructorInjectionComponentAdapterFactory" />
		</component-adapter-factory>
	</component-adapter-factory>

	<!-- Create a specialized component adapter factory, that creates every time a new component -->
	<component-adapter-factory key="BuilderCAF"
		class="org.picocontainer.defaults.ConstructorInjectionComponentAdapterFactory" />

	<!-- Default properties, can be overridden by the properties used to initialize the provider -->
	<component-instance class="java.util.Properties"
		factory="org.nanocontainer.script.xml.XStreamComponentInstanceFactory">
		<properties>
			<property name="queue" value="DOC/ARCH/LOG/ENTRIES/INPUT" />
			<property name="application" value="ARCHIVE" />
		</properties>
	</component-instance>

	<!-- Custom Logging component -->
	<component-adapter class-name-key="com.elsagsolutions.projects.components.custom.logging.CustomLogging"
		class="com.elsagsolutions.projects.components.custom.logging.ConfiguredCustomLogging" factory="BuilderCAF" />

	<!-- Sender factory component -->
	<component-implementation class-name-key="com.elsagsolutions.projects.components.custom.logging.SenderFactory"
		class="com.elsagsolutions.projects.components.custom.logging.ConfiguredJMSWrapperSenderFactory" />

	<!-- JMS Messenger component chain -->
	<component-adapter key="JMSMessenger" class="com.elsagsolutions.projects.components.custom.logging.JMSMessenger"
		factory="ThreadCAF" />
	<component-implementation class-name-key="com.elsagsolutions.projects.components.custom.logging.Messenger"
		class="com.elsagsolutions.projects.components.elar.logging.ConfiguredFilePersistentManager">
		<parameter key="JMSMessenger" />
	</component-implementation>

	<!-- JMS Wrapper component -->
	<component-implementation class="custom.jmswrapper.JMSWrapper" />

</container>
=========== %<============

- Jörg

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.