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

java.lang.Object
  extended by org.codehaus.cargo.util.log.LoggedObject
      extended by org.codehaus.cargo.container.spi.configuration.AbstractConfiguration
          extended by org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
              extended by org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
                  extended by org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
                      extended by org.codehaus.cargo.container.tomcat.internal.AbstractCatalinaStandaloneLocalConfiguration
All Implemented Interfaces:
Configuration, DataSourceSupport, ResourceSupport, LocalConfiguration, StandaloneLocalConfiguration, ContainerConfiguration, Loggable
Direct Known Subclasses:
Tomcat4xStandaloneLocalConfiguration, Tomcat5xStandaloneLocalConfiguration

public abstract class AbstractCatalinaStandaloneLocalConfiguration
extends AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
implements ResourceSupport

Catalina standalone ContainerConfiguration implementation.

Version:
$Id: AbstractCatalinaStandaloneLocalConfiguration.java 1890 2009-02-13 15:39:21Z adriancole $

Field Summary
 
Fields inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
RESOURCE_PATH
 
Constructor Summary
AbstractCatalinaStandaloneLocalConfiguration(java.lang.String dir)
          
 
Method Summary
 void configureDataSources(LocalContainer container)
           note that if there is any datasource configured, this will imply an addition of the transaction manager.
protected  java.lang.String createContextToken(WAR deployable)
           
protected  org.apache.tools.ant.types.FilterChain createTomcatFilterChain()
          
protected  void doConfigure(LocalContainer container)
          
 ConfigurationCapability getCapability()
          
protected  java.util.Set getConfFiles()
          files that should be copied to the conf directory for the server to operate.
protected  java.util.Map getNamespaces()
          Implementations should avoid passing null, and instead pass Collections.EMPTY_MAP, if the document is DTD bound.
 java.lang.String getOrCreateDataSourceConfigurationFile(DataSource ds, LocalContainer container)
          
protected  java.lang.String getSecurityToken()
           
protected  java.lang.String getXpathForDataSourcesParent()
          Resource entries must be stored in the xml configuration file.
protected  void setupConfFiles(LocalContainer container, org.apache.tools.ant.types.FilterChain filterChain)
          copy files to the conf directory, replacing tokens based on the filterchain parameter.
protected abstract  void setupManager(LocalContainer container)
          Setup the manager webapp.
protected abstract  void setupTransactionManager()
          Adds an implementation of UserTransaction to the configuration.
 java.lang.String toString()
          
 
Methods inherited from class org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
configure, configure, configure, configureResources, createConfigurationBuilder, getOrCreateResourceConfigurationFile, getXpathForResourcesParent, writeConfigurationToXpath
 
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
configureFiles, createFilterChain, getDestDirectoryLocation, getDestFileLocation, getFileProperties, getFilterChain, getType, setConfigFileProperty, setFileProperty, setupConfigurationDir, verify
 
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
addDataSource, addDataSourcesFromProperties, addDeployable, addResource, addResourcesFromProperties, collectUnsupportedDataSourcesAndThrowException, collectUnsupportedResourcesAndThrowException, getAntUtils, getDataSources, getDeployables, getFileHandler, getHome, getResources, getResourceUtils, parsePropertiesForPendingConfiguration, setFileHandler
 
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractConfiguration
getProperties, getPropertyValue, setProperty
 
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.codehaus.cargo.container.configuration.entry.ResourceSupport
configure, configureResources
 
Methods inherited from interface org.codehaus.cargo.container.configuration.LocalConfiguration
addDeployable, addResource, getDeployables, getFileHandler, getHome, getResources, setFileHandler
 
Methods inherited from interface org.codehaus.cargo.container.configuration.Configuration
getProperties, getPropertyValue, setProperty
 
Methods inherited from interface org.codehaus.cargo.util.log.Loggable
getLogger, setLogger
 

Constructor Detail

AbstractCatalinaStandaloneLocalConfiguration

public AbstractCatalinaStandaloneLocalConfiguration(java.lang.String dir)

See Also:
AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder#AbstractStandaloneLocalConfigurationWithDataSourceSupport(String)
Method Detail

doConfigure

protected void doConfigure(LocalContainer container)
                    throws java.lang.Exception

Specified by:
doConfigure in class AbstractLocalConfiguration
Throws:
java.lang.Exception
See Also:
AbstractLocalConfiguration.configure(LocalContainer)

configureDataSources

public void configureDataSources(LocalContainer container)
note that if there is any datasource configured, this will imply an addition of the transaction manager.

Specified by:
configureDataSources in interface DataSourceSupport
Overrides:
configureDataSources in class AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
See Also:
setupTransactionManager()

setupTransactionManager

protected abstract void setupTransactionManager()
Adds an implementation of UserTransaction to the configuration.


getConfFiles

protected java.util.Set getConfFiles()
files that should be copied to the conf directory for the server to operate.

Returns:
set of filenames to copy upon doConfigure

setupManager

protected abstract void setupManager(LocalContainer container)
Setup the manager webapp.

Parameters:
container - the container to configure

createTomcatFilterChain

protected org.apache.tools.ant.types.FilterChain createTomcatFilterChain()

See Also:
AbstractStandaloneLocalConfiguration.createFilterChain()

createContextToken

protected java.lang.String createContextToken(WAR deployable)
Parameters:
deployable - the WAR to deploy
Returns:
the "context" XML element to instert in the Tomcat server.xml configuration file

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getCapability

public ConfigurationCapability getCapability()

Specified by:
getCapability in interface Configuration
See Also:
Configuration.getCapability()

getSecurityToken

protected java.lang.String getSecurityToken()
Returns:
an Ant filter token containing all the user-defined users

setupConfFiles

protected void setupConfFiles(LocalContainer container,
                              org.apache.tools.ant.types.FilterChain filterChain)
                       throws java.io.IOException
copy files to the conf directory, replacing tokens based on the filterchain parameter.

Parameters:
container - - type of container configuration we are using.
filterChain - - holds tokenization details
Throws:
java.io.IOException - - if we cannot copy a file to the 'conf' directory

getXpathForDataSourcesParent

protected java.lang.String getXpathForDataSourcesParent()
Resource entries must be stored in the xml configuration file. Under which element do we insert the entries? example: //Engine/DefaultContext

Specified by:
getXpathForDataSourcesParent in class AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
Returns:
path the the parent element resources should be inserted under.

getOrCreateDataSourceConfigurationFile

public java.lang.String getOrCreateDataSourceConfigurationFile(DataSource ds,
                                                               LocalContainer container)

Specified by:
getOrCreateDataSourceConfigurationFile in class AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder

getNamespaces

protected java.util.Map getNamespaces()
Implementations should avoid passing null, and instead pass Collections.EMPTY_MAP, if the document is DTD bound.

Specified by:
getNamespaces in class AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
Returns:
a map of prefixes to the url namespaces used in the datasource or resource configuration file.


Copyright © 2004-2011 Codehaus. All Rights Reserved.