Managed Hosting



ColdSpring Bean Utilities
Project Home Blog Forums Wiki Known Issues Contact Project

Author: Brian Kotek (All RIAForge projects by this author)
Last Updated: December 15, 2009 10:56 PM
Version: 1.3
Views: 72,857
Downloads: 1,811
Demo URL: http://www.briankotek.com/blog/index.cfm/2008/7/10/DynamicXMLBeanFactory-and-Custom-FactoryBeans-added-to-ColdSpring-Utils-Project
License: Apache License, Version 2


Each component listed here has full documentation and usage examples in the comments at the top of each file.

Updated on 3/22/2009 to include a thread safety patch from Jon Messer.

Updated on 7/9/2008 to include updates to the AbstractMetadataAwareAdvice and VOConverterAdvice, as well as added the DynamicXMLBeanFactory, MetadataAwareProxyFactoryBean, and MetadataAwareRemoteFactoryBean. I also added an example subdirectory to demonstrate usage of some of the new components.

This package includes a variety of utilities and other useful components to support development using ColdSpring. Each component has a full description in the comments, and I have several blog posts on these at my blog, http://www.briankotek.com/blog.

DynamicXMLBeanFactory: This extends the standard DefaultXMLBeanFactory but allows the ability to replace dynamic properties anywhere in the XML file, as well as in imported XML files.

MetadataAwareProxyFactoryBean: This extends the ColdSpring ProxyFactoryBean and automatically injects metadata information into any Advices that extend AbstractMetadataAwareAdvice after the AOP proxy is created.

MetadataAwareRemoteFactoryBean: This extends the ColdSpring RemoteFactoryBean and automatically injects metadata information into any Advices that extend AbstractMetadataAwareAdvice after the remote proxy is created.

BeanInjector.cfc: The component will autowire any other component with ColdSpring-managed beans. Very useful for injecting ColdSpring beans (mainly Singletons) into transient objects.

TDOBeanInjectorObserver.cfc: This component uses the BeanInjector to automatically autowire Transfer Decorator objects with ColdSpring beans. Transfer is an ORM (object-relational mapping) framework for ColdFusion. Using this observer allows your Transfer Decorators to supply much richer behavior and allows them to act as real Business Objects rather than simple data containers for database data.

AbstractMetadataAwareAdvice.cfc: An abstract ColdSpring AOP Advice that leverages an XML file to supply metadata to your Advices. This greatly enhances the capabilities of an Advice because you can supply information that the Advice can act upon that it would otherwise be unaware of.

VOConverterAdvice.cfc: This Advice extends AbstractMetadataAwareAdvice and allows you to specify a converter component that will perform some kind of conversion on the data being returned by the proxied component. It uses the metadata supplied by the superclass to determine what converter to invoke, and passes the metadata into the converter for its use in doing its work.

GenericVOConverter.cfc: This is a generic Value Object converter that can be used by the VOConverterAdvice that will convert queries, arrays, or structures into objects of the type specified by the metadata. It isn't incredibly useful because it currently returns the structure keys in uppercase but it is meant as a starting point for creating your own converters.

This component will replace dynamic properties in a ColdSpring XML file with values specified in the passed structure. ColdSpring itself allows for some dynamic properties, but only in certain places in the XML such as constructor argument values. Using this CFC allows you to place dynamic properties anywhere in the XML. It also handles replacing dynamic properties on any imported ColdSpring files that use the <import> tag.


These have only been tested on ColdFusion 8, and they require the latest version of ColdSpring to use. Also, the Transfer observer requires the latest release of the Transfer ORM.

The DynamicXMLBeanFactory and ColdSpringXMLUtils components require Java 5 or later, which most installs of CF7 or 8 should already have. However, it also uses ReMatchNoCase() which is only supported on CF8.

Issue Tracker:

3 DynamicXMLBeanFactory issue on CF8 Open 03/10/10 9:57 AM
1 DynamicXMLBeanFactory always expands path of xml file Closed 12/15/09 10:53 PM
2 Error Occurred While Processing Request http://localhost/beanutils/example/ Closed 12/15/09 10:52 PM

View All Issues

To enter issues for this (or any other) project, you must be logged in.

Subversion Access:

You may access this project's Subversion repository with your client here: http://svn.riaforge.org/coldspringutils.

To view files and changelists associated with this repository, go here: http://coldspringutils.riaforge.org/index.cfm?event=page.svnbrowse.

Anonymous users have read access to the repository while the administrator has write access.

This project is sharing its code via Subversion. Subversion is an open source source control method. You may find more information about Subversion here: http://subversion.tigris.org/