# Codehaus Cargo : Resource and DataSource Implementation

Created by Adrian Cole, last modified on Feb 13, 2009

new set of classes to manage Resource and DataSource types.

POJOs that hold configuration details given from the user:
o.c.c.c.configuration.entry.Resource
o.c.c.c.configuration.entry.DataSource

Interfaces declaring support of the above (for use on LocalConfiguration classes)
o.c.c.c.configuration.entry.ResourceSupport
o.c.c.c.configuration.entry.DataSourceSupport

Class used to convert DataSource and Resource Objects to a String for use in configuration files:
o.c.c.c.configuration.builder.ConfigurationBuilder

Class holding constants of configuration entry types (like java.sql.DataSource):
o.c.c.c.configuration.builder.ConfigurationEntryType

Base class that provides hooks for common DataSource types
o.c.c.c.spi.configuration.builder.AbstractConfigurationBuilder

LocalConfigurationWithConfigurationBuilderTests

Classes that convert the POJOs to and from Properties objects:
o.c.c.c.property.ResourceConverter
o.c.c.c.property.DataSourceConverter
o.c.c.c.property.ResourcePropertySet
o.c.c.c.property.DatasourcePropertySet

Test Fixtures that hold the configuration deviations all Configurations should implement
o.c.c.c.configuration.entry.DataSourceFixture
o.c.c.c.configuration.entry.ConfigurationFixtureFactory
o.c.c.c.configuration.entry.ResourceFixture

Helper interface that you implement to validate your ConfigurationBuilder
o.c.c.c.configuration.builder.ConfigurationChecker

Interface declaring Tests needed to ensure your Builder supports all known Resource and DataSource types.
o.c.c.c.configuration.builder.ConfigurationBuilderTests

Base implementation so that tests your ConfigurationBuilder against all known tests:
o.c.c.c.spi.configuration.builder.AbstractConfigurationBuilderTest

Resource integration in maven:
o.c.c.maven2/configuration/ConfigurationTest.java
o.c.c.maven2/configuration/Resource.java

LocalConfiguration supports collections of DataSources and Resources.

AbstractLocalConfiguration will throw an exception if during verify() an unsupported Resource or DataSource is found.

AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder will use ConfigurationBuilder to assemble any Resources or DataSources and insert them into its XML file.

AbstractLocalConfigurationWithConfigurationBuilderTest will test the above, ensuring all supported configurations operate

Classes you need to implement for configuration support:

subclass of AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
uses subclass of AbstractConfigurationBuilder
tested by subclass of AbstractConfigurationBuilderTest.java
tested by subclass of AbstractLocalConfigurationWithConfigurationBuilderTest
uses implementation ConfigurationChecker