public abstract class AbstractStandaloneLocalConfiguration extends AbstractLocalConfiguration implements StandaloneLocalConfiguration
RESOURCE_PATH| Constructor and Description |
|---|
AbstractStandaloneLocalConfiguration(String dir) |
| Modifier and Type | Method and Description |
|---|---|
void |
addXmlReplacement(String filename,
String xpathExpression,
String configurationPropertyName)
Adds an XML replacement.
|
void |
addXmlReplacement(String filename,
String xpathExpression,
String attributeName,
String configurationPropertyName)
Adds an XML replacement.
|
void |
addXmlReplacement(XmlReplacement xmlReplacement)
Adds an XML replacement.
|
protected void |
configureFiles(org.apache.tools.ant.types.FilterChain filterChain,
LocalContainer container)
Copy the customized configuration files into the cargo home directory.
|
ConfigurationType |
getType() |
protected void |
performXmlReplacements(LocalContainer container)
Perform the XML replacements for the specified container.
|
void |
removeXmlReplacement(String filename,
String xpathExpression)
Removes an XML replacement.
|
void |
removeXmlReplacement(String filename,
String xpathExpression,
String attributeName)
Removes an XML replacement.
|
protected void |
replaceInFile(String file,
Map<String,String> replacements,
String encoding)
Replaces using a map of replacements in a given file.
|
protected void |
setupConfigurationDir()
Set up the configuration directory (create it and clean it).
|
void |
verify()
Verify that the configuration is valid.
|
addDataSource, addDataSourcesFromProperties, addDeployable, addResource, addResourcesFromProperties, applyPortOffset, applyPortOffset, collectUnsupportedDataSourcesAndThrowException, collectUnsupportedResourcesAndThrowException, configure, createFilterChain, doConfigure, getAntUtils, getDataSources, getDeployables, getDestDirectoryLocation, getDestFileLocation, getFileHandler, getFileProperties, getFilterChain, getHome, getResources, getResourceUtils, parsePropertiesForPendingConfiguration, revertPortOffset, revertPortOffset, setConfigFileProperty, setFileHandler, setFileProperty, setLoggergetProperties, getPropertyValue, setPropertygetLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddDataSource, addDeployable, addResource, applyPortOffset, configure, getDataSources, getDeployables, getFileHandler, getFileProperties, getHome, getResources, revertPortOffset, setConfigFileProperty, setFileHandler, setFilePropertygetCapability, getProperties, getPropertyValue, setPropertypublic AbstractStandaloneLocalConfiguration(String dir)
protected void performXmlReplacements(LocalContainer container)
container - the container to configureprotected void setupConfigurationDir()
throws IOException
Note: We only clean the configuration directory if it's empty or if there is a Cargo timestamp file. This is to prevent deleting not empty directories if the user has mistakenly pointed the configuration dir to an existing location.
IOException - if the directory cannot be createdpublic void addXmlReplacement(XmlReplacement xmlReplacement)
addXmlReplacement in interface StandaloneLocalConfigurationxmlReplacement - XML replacement to add.public void addXmlReplacement(String filename, String xpathExpression, String configurationPropertyName)
addXmlReplacement in interface StandaloneLocalConfigurationfilename - File in which to replace.xpathExpression - XPath expression to look for.configurationPropertyName - Name of the configuration property to set. The XML
replacement will be ignored if the property is set to null.public void addXmlReplacement(String filename, String xpathExpression, String attributeName, String configurationPropertyName)
addXmlReplacement in interface StandaloneLocalConfigurationfilename - File in which to replace.xpathExpression - XPath expression to look for.attributeName - Attribute name to modify. If null, the node's contents
will be modified.configurationPropertyName - Name of the configuration property to set. The XML
replacement will be ignored if the property is set to null.public void removeXmlReplacement(String filename, String xpathExpression)
removeXmlReplacement in interface StandaloneLocalConfigurationfilename - File in which to replace.xpathExpression - XPath expression to look for.public void removeXmlReplacement(String filename, String xpathExpression, String attributeName)
removeXmlReplacement in interface StandaloneLocalConfigurationfilename - File in which to replace.xpathExpression - XPath expression to look for.attributeName - Attribute name to modify. If null, the node's contents
will be modified.public void verify()
verify in interface ContainerConfigurationverify in class AbstractLocalConfigurationContainerConfiguration.verify()public ConfigurationType getType()
getType in interface ConfigurationConfiguration.getType()protected void configureFiles(org.apache.tools.ant.types.FilterChain filterChain,
LocalContainer container)
configureFiles in class AbstractLocalConfigurationfilterChain - the filter chain to use during the copycontainer - local containerprotected void replaceInFile(String file, Map<String,String> replacements, String encoding) throws CargoException
file - File to replace in.replacements - Map containing replacements.encoding - The character encoding to use, may be null or empty to use the
platform's default encoding.CargoException - If anything fails, most notably if one of the replacements does not
exist in the file.Copyright © 2004-2013 Codehaus. All Rights Reserved.