Class AbstractCatalinaStandaloneLocalConfiguration
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.configuration.AbstractConfiguration
-
- org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
-
- org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
-
- org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
-
- 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
Catalina standaloneContainerConfigurationimplementation.
-
-
Field Summary
-
Fields inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
RESOURCE_PATH
-
-
Constructor Summary
Constructors Constructor Description AbstractCatalinaStandaloneLocalConfiguration(String dir)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringconnectorXpath()XPath expression for identifying the "Connector" element in the server.xml file.protected StringcreateContextToken(WAR deployable)protected TomcatCopyingInstalledLocalDeployercreateDeployer(LocalContainer container)Creates the Tomcat deployer.protected StringcreateTomcatWebappsToken()Create the Tomcat<webapp>token.protected voiddoConfigure(LocalContainer container)Implementation ofLocalConfiguration.configure(LocalContainer)that all local configuration using this class must implement.protected StringescapePath(String path)Escapes a Windows path: backslashes become slashes, drive paths get prefixed with a slash.protected Map<String,String>getNamespaces()Implementations should avoid passing null, and instead passCollections.emptyMap(), if the document is DTD bound.StringgetOrCreateDataSourceConfigurationFile(DataSource ds, LocalContainer container)note that this file could hold other configuration besides datasources.protected StringgetSecurityToken()protected StringgetTomcatLoggingLevel(String cargoLoggingLevel)Translate Cargo logging levels into Tomcat logging levels.protected StringgetXpathForDataSourcesParent()Resource entries must be stored in the xml configuration file.voidsetProperty(String name, String value)A property is a configuration value for the container (eg the web port, the number of executing threads, etc).protected abstract voidsetupConfFiles(String confDir)setup the files in the configuration'sconfdirectory.protected abstract voidsetupManager(LocalContainer container)Setup the manager webapp.protected voidsetupWebApps(LocalContainer container)Setup the web apps directory and deploy applications.StringtoString()-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
configure, configure, configure, configureDataSources, configureResources, createConfigurationBuilder, getOrCreateResourceConfigurationFile, getXpathForResourcesParent, writeConfigurationToXpath
-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
addXmlReplacement, addXmlReplacement, addXmlReplacement, addXmlReplacement, configureFiles, getType, getXmlReplacements, performXmlReplacements, removeXmlReplacement, removeXmlReplacement, replaceInFile, setupConfigurationDir, verify
-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
addDataSource, addDataSourcesFromProperties, addDeployable, addResource, addResourcesFromProperties, addUser, addUsersFromProperties, applyPortOffset, applyPortOffset, collectUnsupportedDataSourcesAndThrowException, collectUnsupportedResourcesAndThrowException, flagOffsetApplied, getDataSources, getDeployables, getDestDirectoryLocation, getDestFileLocation, getFileHandler, getFileProperties, getHome, getPropertyValue, getReplacements, getResources, getResourceUtils, getUsers, isOffsetApplied, isOffsetApplied, parsePropertiesForPendingConfiguration, revertPortOffset, revertPortOffset, setConfigFileProperty, setFileHandler, setFileProperty, setLogger
-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractConfiguration
getProperties
-
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger
-
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.Configuration
getCapability, getProperties, getPropertyValue
-
Methods inherited from interface org.codehaus.cargo.container.configuration.LocalConfiguration
addDataSource, addDeployable, addResource, addUser, applyPortOffset, getDataSources, getDeployables, getFileHandler, getFileProperties, getHome, getResources, getUsers, isOffsetApplied, revertPortOffset, setConfigFileProperty, setFileHandler, setFileProperty
-
-
-
-
Constructor Detail
-
AbstractCatalinaStandaloneLocalConfiguration
public AbstractCatalinaStandaloneLocalConfiguration(String dir)
-
-
Method Detail
-
setProperty
public void setProperty(String name, String value)
A property is a configuration value for the container (eg the web port, the number of executing threads, etc).- Specified by:
setPropertyin interfaceConfiguration- Overrides:
setPropertyin classAbstractConfiguration- Parameters:
name- the property namevalue- the property value
-
doConfigure
protected void doConfigure(LocalContainer container) throws Exception
Implementation ofLocalConfiguration.configure(LocalContainer)that all local configuration using this class must implement. This provides the ability to perform generic actions before and after the container-specific implementation. Another way would be to use AOP...- Specified by:
doConfigurein classAbstractLocalConfiguration- Parameters:
container- the container to configure- Throws:
Exception- if any error is raised during the configuration
-
escapePath
protected String escapePath(String path)
Escapes a Windows path: backslashes become slashes, drive paths get prefixed with a slash.- Parameters:
path- Path to escape.- Returns:
- Escaped path.
-
setupManager
protected abstract void setupManager(LocalContainer container)
Setup the manager webapp.- Parameters:
container- the container to configure
-
setupWebApps
protected void setupWebApps(LocalContainer container)
Setup the web apps directory and deploy applications.- Parameters:
container- the container to configure
-
getTomcatLoggingLevel
protected String getTomcatLoggingLevel(String cargoLoggingLevel)
Translate Cargo logging levels into Tomcat logging levels.- Parameters:
cargoLoggingLevel- Cargo logging level- Returns:
- the corresponding Tomcat logging level
-
createTomcatWebappsToken
protected String createTomcatWebappsToken()
Create the Tomcat<webapp>token.- Returns:
- The Tomcat
<webapp>token.
-
createContextToken
protected String createContextToken(WAR deployable)
- Parameters:
deployable- the WAR to deploy- Returns:
- the "context" XML element to instert in the Tomcat
server.xmlconfiguration file
-
getSecurityToken
protected String getSecurityToken()
- Returns:
- an Ant filter token containing all the user-defined users
-
setupConfFiles
protected abstract void setupConfFiles(String confDir)
setup the files in the configuration'sconfdirectory.- Parameters:
confDir- - theconfdirectory.
-
getXpathForDataSourcesParent
protected 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:
getXpathForDataSourcesParentin classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder- Returns:
- path the the parent element resources should be inserted under.
-
getOrCreateDataSourceConfigurationFile
public String getOrCreateDataSourceConfigurationFile(DataSource ds, LocalContainer container)
note that this file could hold other configuration besides datasources.- Specified by:
getOrCreateDataSourceConfigurationFilein classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder- Parameters:
ds- the DataSource configuration you wish to install on the container.container- the container whose configuration you wish to affect.- Returns:
- the file that holds datasource configuration.
-
getNamespaces
protected Map<String,String> getNamespaces()
Implementations should avoid passing null, and instead passCollections.emptyMap(), if the document is DTD bound.- Specified by:
getNamespacesin classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder- Returns:
- a map of prefixes to the url namespaces used in the datasource or resource configuration file.
-
createDeployer
protected TomcatCopyingInstalledLocalDeployer createDeployer(LocalContainer container)
Creates the Tomcat deployer.- Parameters:
container- Container to create a deployer for.- Returns:
- Tomcat deployer.
-
connectorXpath
protected String connectorXpath()
XPath expression for identifying the "Connector" element in the server.xml file.Handles the fact that this connector protocol value might have changed.
- Returns:
- the xpath expression for a http connector
-
-