org.codehaus.cargo.container.tomcat.internal
Class AbstractTomcatConfigurationBuilder

java.lang.Object
  extended by org.codehaus.cargo.container.spi.configuration.builder.AbstractConfigurationBuilder
      extended by org.codehaus.cargo.container.tomcat.internal.AbstractTomcatConfigurationBuilder
All Implemented Interfaces:
ConfigurationBuilder
Direct Known Subclasses:
Tomcat4xConfigurationBuilder, Tomcat5And6xConfigurationBuilder

public abstract class AbstractTomcatConfigurationBuilder
extends AbstractConfigurationBuilder

Constructs xml elements needed to configure a DataSource for Tomcat. Note that this implementation converts DataSources into Resources and then uses an appropriate ConfigurationBuilder to create the configuration.

Version:
$Id: $

Field Summary
protected  java.util.Map typeToFactory
          contains a mapping of resource types to the factory they use.
 
Constructor Summary
AbstractTomcatConfigurationBuilder()
          generates typeToFactory
 
Method Summary
 java.lang.String buildConfigurationEntryForXADataSourceConfiguredDataSource(DataSource ds)
           This throws an UnsupportedOperationException as Tomcat is not transactional.
 java.lang.String buildEntryForDriverConfiguredDataSourceWithLocalTx(DataSource ds)
           This throws an UnsupportedOperationException as Tomcat is not transactional.
 java.lang.String buildEntryForDriverConfiguredDataSourceWithNoTx(DataSource ds)
           this implementation first converts the DataSource to a Resource before returning XML.
 java.lang.String buildEntryForDriverConfiguredDataSourceWithXaTx(DataSource ds)
           This throws an UnsupportedOperationException as Tomcat is not transactional.
protected  java.lang.String convertDataSourceToResourceAndGetXMLEntry(DataSource ds)
          This method converts the DataSource to a Resource and then builds the xml entry based on that.
protected  Resource convertToResource(DataSource ds)
          This method converts the DataSource to a Resource used in Tomcat.
protected  java.lang.String getFactoryClassFor(java.lang.String type)
           
 
Methods inherited from class org.codehaus.cargo.container.spi.configuration.builder.AbstractConfigurationBuilder
toConfigurationEntry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.cargo.container.configuration.builder.ConfigurationBuilder
toConfigurationEntry
 

Field Detail

typeToFactory

protected java.util.Map typeToFactory
contains a mapping of resource types to the factory they use. There should always be a key "default" which can be used for unknown objects.

Constructor Detail

AbstractTomcatConfigurationBuilder

public AbstractTomcatConfigurationBuilder()
generates typeToFactory

Method Detail

buildEntryForDriverConfiguredDataSourceWithNoTx

public java.lang.String buildEntryForDriverConfiguredDataSourceWithNoTx(DataSource ds)
this implementation first converts the DataSource to a Resource before returning XML.

Specified by:
buildEntryForDriverConfiguredDataSourceWithNoTx in class AbstractConfigurationBuilder
See Also:
convertDataSourceToResourceAndGetXMLEntry(DataSource)

convertDataSourceToResourceAndGetXMLEntry

protected java.lang.String convertDataSourceToResourceAndGetXMLEntry(DataSource ds)
This method converts the DataSource to a Resource and then builds the xml entry based on that.

Parameters:
ds - the DataSource we are configuring.
Returns:
a datasource xml fragment that can be embedded directly into the server.xml file

convertToResource

protected Resource convertToResource(DataSource ds)
This method converts the DataSource to a Resource used in Tomcat.

Parameters:
ds - the DataSource we are configuring.
Returns:
a Resource that can be used in Tomcat.

getFactoryClassFor

protected java.lang.String getFactoryClassFor(java.lang.String type)
Parameters:
type - the type of object we are creating
Returns:
the factory responsible for creating the objects.

buildConfigurationEntryForXADataSourceConfiguredDataSource

public java.lang.String buildConfigurationEntryForXADataSourceConfiguredDataSource(DataSource ds)
This throws an UnsupportedOperationException as Tomcat is not transactional.

Specified by:
buildConfigurationEntryForXADataSourceConfiguredDataSource in class AbstractConfigurationBuilder

buildEntryForDriverConfiguredDataSourceWithLocalTx

public java.lang.String buildEntryForDriverConfiguredDataSourceWithLocalTx(DataSource ds)
This throws an UnsupportedOperationException as Tomcat is not transactional.

Specified by:
buildEntryForDriverConfiguredDataSourceWithLocalTx in class AbstractConfigurationBuilder

buildEntryForDriverConfiguredDataSourceWithXaTx

public java.lang.String buildEntryForDriverConfiguredDataSourceWithXaTx(DataSource ds)
This throws an UnsupportedOperationException as Tomcat is not transactional.

Specified by:
buildEntryForDriverConfiguredDataSourceWithXaTx in class AbstractConfigurationBuilder


Copyright © 2004-2011 Codehaus. All Rights Reserved.