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
Tomcat5xInstalledLocalContainerandTomcat5xEmbeddedLocalContainer.
-
-
Field Summary
Fields Modifier and Type Field Description protected Tomcat5x6x7xConfigurationBuilderconfigurationBuilderused 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 voidconfigureExtraClasspathToken(WAR deployable, Element context)Configures the specified context element with the extra classpath (if any) of the given WAR.protected ConfigurationBuildercreateConfigurationBuilder(LocalContainer container)protected StringcreateContextToken(WAR deployable)Override the context element creation as Tomcat 5x and newer don't support the debug attribute.ConfigurationCapabilitygetCapability()protected Map<String,String>getCatalinaPropertertiesReplacements()protected StringgetExtraClasspathToken(WAR deployable)Creates the extra classpath XML token.protected StringgetExtraContextAttributes()Allows adding attributes during the creation of <Context/> element for Tomcat > 5.x.protected StringgetOrCreateResourceConfigurationFile(Resource rs, LocalContainer container)note that this file could hold other configuration besides Resources.protected StringgetTomcatLoggingLevel(String cargoLoggingLevel)Translate Cargo logging levels into java.util.logging levels.protected StringgetXpathForResourcesParent()Resource entries must be stored in the xml configuration file.protected voidperformXmlReplacements(LocalContainer container)Perform the XML replacements for the specified container.protected voidsetupConfFiles(String confDir)setup the files in the configuration'sconfdirectory.protected voidsetupManager(LocalContainer container)Setup the manager webapp.StringtoString()-
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
ConfigurationCapabilityof the configuration in term of properties it supports, etc
-
createConfigurationBuilder
protected ConfigurationBuilder createConfigurationBuilder(LocalContainer container)
- Specified by:
createConfigurationBuilderin 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:
setupManagerin classAbstractCatalinaStandaloneLocalConfiguration- Parameters:
container- the container to configure
-
performXmlReplacements
protected void performXmlReplacements(LocalContainer container)
Perform the XML replacements for the specified container.- Overrides:
performXmlReplacementsin classAbstractStandaloneLocalConfiguration- Parameters:
container- the container to configure
-
toString
public String toString()
- Overrides:
toStringin 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:
getXpathForResourcesParentin 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:
getOrCreateResourceConfigurationFilein 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:
getTomcatLoggingLevelin 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:
createContextTokenin classAbstractCatalinaStandaloneLocalConfiguration- Parameters:
deployable- the WAR to deploy- Returns:
- the "context" XML element to instert in the Tomcat
server.xmlconfiguration 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.xmlconfiguration file.
-
setupConfFiles
protected void setupConfFiles(String confDir)
setup the files in the configuration'sconfdirectory.- Specified by:
setupConfFilesin classAbstractCatalinaStandaloneLocalConfiguration- Parameters:
confDir- - theconfdirectory.
-
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.
-
-