Class Tomcat5xStandaloneLocalConfiguration
- 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
-
- org.codehaus.cargo.container.tomcat.Tomcat5xStandaloneLocalConfiguration
-
- All Implemented Interfaces:
Configuration
,DataSourceSupport
,ResourceSupport
,LocalConfiguration
,StandaloneLocalConfiguration
,ContainerConfiguration
,Loggable
- Direct Known Subclasses:
Tomcat6xStandaloneLocalConfiguration
public class Tomcat5xStandaloneLocalConfiguration extends AbstractCatalinaStandaloneLocalConfiguration
StandAloneLocalConfiguration that is appropriate for Tomcat 5.x containers.This code needs to work with both
Tomcat5xInstalledLocalContainer
andTomcat5xEmbeddedLocalContainer
.
-
-
Field Summary
Fields Modifier and Type Field Description protected Tomcat5x6x7xConfigurationBuilder
configurationBuilder
used to insert DataSources and Resources into the configuration file.-
Fields inherited from class org.codehaus.cargo.container.spi.configuration.AbstractLocalConfiguration
RESOURCE_PATH
-
-
Constructor Summary
Constructors Constructor Description Tomcat5xStandaloneLocalConfiguration(String dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureExtraClasspathToken(WAR deployable, Element context)
Configures the specified context element with the extra classpath (if any) of the given WAR.protected ConfigurationBuilder
createConfigurationBuilder(LocalContainer container)
protected String
createContextToken(WAR deployable)
Override the context element creation as Tomcat 5x and newer don't support the debug attribute.ConfigurationCapability
getCapability()
protected Map<String,String>
getCatalinaPropertertiesReplacements()
protected String
getExtraClasspathToken(WAR deployable)
Creates the extra classpath XML token.protected String
getExtraContextAttributes()
Allows adding attributes during the creation of <Context/> element for Tomcat > 5.x.protected String
getOrCreateResourceConfigurationFile(Resource rs, LocalContainer container)
note that this file could hold other configuration besides Resources.protected String
getTomcatLoggingLevel(String cargoLoggingLevel)
Translate Cargo logging levels into java.util.logging levels.protected String
getXpathForResourcesParent()
Resource entries must be stored in the xml configuration file.protected void
performXmlReplacements(LocalContainer container)
Perform the XML replacements for the specified container.protected void
setupConfFiles(String confDir)
setup the files in the configuration'sconf
directory.protected void
setupManager(LocalContainer container)
Setup the manager webapp.String
toString()
-
Methods inherited from class org.codehaus.cargo.container.tomcat.internal.AbstractCatalinaStandaloneLocalConfiguration
connectorXpath, createDeployer, createTomcatWebappsToken, doConfigure, escapePath, getNamespaces, getOrCreateDataSourceConfigurationFile, getSecurityToken, getXpathForDataSourcesParent, setProperty, setupWebApps
-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.builder.AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
configure, configure, configure, configureDataSources, configureResources, writeConfigurationToXpath
-
Methods inherited from class org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration
addXmlReplacement, addXmlReplacement, addXmlReplacement, addXmlReplacement, configureFiles, getType, getXmlReplacements, 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
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
-
-
-
-
Field Detail
-
configurationBuilder
protected Tomcat5x6x7xConfigurationBuilder configurationBuilder
used to insert DataSources and Resources into the configuration file.
-
-
Constructor Detail
-
Tomcat5xStandaloneLocalConfiguration
public Tomcat5xStandaloneLocalConfiguration(String dir)
-
-
Method Detail
-
getCapability
public ConfigurationCapability getCapability()
- Returns:
- the
ConfigurationCapability
of the configuration in term of properties it supports, etc
-
createConfigurationBuilder
protected ConfigurationBuilder createConfigurationBuilder(LocalContainer container)
- Specified by:
createConfigurationBuilder
in classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- Parameters:
container
- Container the dataSource will be configured on.- Returns:
- the object that produces xml entries for DataSource definitions.
-
setupManager
protected void setupManager(LocalContainer container)
Setup the manager webapp. this does not deploy the manager, if the application is embedded.- Specified by:
setupManager
in classAbstractCatalinaStandaloneLocalConfiguration
- Parameters:
container
- the container to configure
-
performXmlReplacements
protected void performXmlReplacements(LocalContainer container)
Perform the XML replacements for the specified container.- Overrides:
performXmlReplacements
in classAbstractStandaloneLocalConfiguration
- Parameters:
container
- the container to configure
-
toString
public String toString()
- Overrides:
toString
in classAbstractCatalinaStandaloneLocalConfiguration
-
getXpathForResourcesParent
protected String getXpathForResourcesParent()
Resource entries must be stored in the xml configuration file. Under which element do we insert the entries? example: //Engine/DefaultContext- Specified by:
getXpathForResourcesParent
in classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- Returns:
- path the the parent element Resources should be inserted under.
-
getOrCreateResourceConfigurationFile
protected String getOrCreateResourceConfigurationFile(Resource rs, LocalContainer container)
note that this file could hold other configuration besides Resources. In Tomcat 5.5+, we use context.xml to avoid configuration problems.- Specified by:
getOrCreateResourceConfigurationFile
in classAbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder
- Parameters:
rs
- the Resource configuration you wish to install on the container.container
- the container whose configuration you wish to affect.- Returns:
- the file that holds Resource configuration.
-
getTomcatLoggingLevel
protected String getTomcatLoggingLevel(String cargoLoggingLevel)
Translate Cargo logging levels into java.util.logging levels. Available levels are: SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST or ALL.- Overrides:
getTomcatLoggingLevel
in classAbstractCatalinaStandaloneLocalConfiguration
- Parameters:
cargoLoggingLevel
- Cargo logging level- Returns:
- the corresponding Tomcat java.util.logging level
-
createContextToken
protected String createContextToken(WAR deployable)
Override the context element creation as Tomcat 5x and newer don't support the debug attribute.- Overrides:
createContextToken
in classAbstractCatalinaStandaloneLocalConfiguration
- Parameters:
deployable
- the WAR to deploy- Returns:
- the "context" XML element to instert in the Tomcat
server.xml
configuration file
-
getExtraContextAttributes
protected String getExtraContextAttributes()
Allows adding attributes during the creation of <Context/> element for Tomcat > 5.x.- Returns:
- the extra "context" XML attributes to insert in the Tomcat
server.xml
configuration file.
-
setupConfFiles
protected void setupConfFiles(String confDir)
setup the files in the configuration'sconf
directory.- Specified by:
setupConfFiles
in classAbstractCatalinaStandaloneLocalConfiguration
- Parameters:
confDir
- - theconf
directory.
-
getCatalinaPropertertiesReplacements
protected Map<String,String> getCatalinaPropertertiesReplacements()
- Returns:
- The replacements for
catalina.properties
.
-
getExtraClasspathToken
protected String getExtraClasspathToken(WAR deployable)
Creates the extra classpath XML token.- Parameters:
deployable
- Deployable to create extra classpath XML token for.- Returns:
- Extra classpath XML token.
-
configureExtraClasspathToken
protected void configureExtraClasspathToken(WAR deployable, Element context)
Configures the specified context element with the extra classpath (if any) of the given WAR.- Parameters:
deployable
- Deployable to create extra classpath XML token for.context
- The context element to configure, must not benull
.
-
-