Skip to content

Commit

Permalink
Fixed locators being written before cache XML file copied
Browse files Browse the repository at this point in the history
  • Loading branch information
DivineEnder committed Jun 29, 2017
1 parent 5636b92 commit aeeab24
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ public String getInstallPath() {
*/
public abstract void setLocator(String address, int port) throws Exception;

/**
* Sets up the cache XML files
*/
public abstract void setupCacheXMLFile(String newXMLFilePath) throws IOException;

/**
* Sets the XML file which contains cache properties.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ private InstalledLocalContainer addContainer(ContainerInstall install, int index
ConfigurationType.STANDALONE, "/tmp/cargo_configs/" + uniqueName);
configuration.setProperty(GeneralPropertySet.LOGGING, install.getLoggingLevel());

install.setupCacheXMLFile("cargo_logs/XMLs/" + uniqueName + ".xml");
install.modifyConfiguration(configuration);

File gemfireLogFile = new File("cargo_logs/gemfire_modules/" + uniqueName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,17 @@ public GenericAppServerInstall(Server server, CacheType cacheType, String instal
this.cacheType = cacheType;

appServerModulePath = findAndExtractModule(GEODE_BUILD_HOME, "appserver");
// Set the cache XML file by copying the XML file in the build dir
setCacheXMLFile(appServerModulePath + "/conf/" + cacheType.getXMLTypeFile(),
"cargo_logs/XMLs/" + getContainerDescription() + ".xml");

// Default properties
setCacheProperty("enable_local_cache", "false");

warFile = File.createTempFile("session-testing", ".war", new File("/tmp"));
warFile.deleteOnExit();
}

/**
* Sets the XML file to use for cache settings
*
* Calls {@link ContainerInstall#setCacheXMLFile(String, String)} with the default original cache
* file located in the conf folder of the {@link #appServerModulePath} and the given
* newXMLFilePath.
*/
@Override
public void setupCacheXMLFile(String newXMLFilePath) throws IOException {
super.setCacheXMLFile(appServerModulePath + "/conf/" + cacheType.getXMLTypeFile(),
newXMLFilePath);
}

/**
* Build the command list used to modify/build the WAR file
*/
Expand Down Expand Up @@ -240,8 +231,7 @@ public void setLocator(String address, int port) throws Exception {
attributes.put("host", address);
attributes.put("port", Integer.toString(port));

editXMLFile(appServerModulePath + "/conf/" + cacheType.getXMLTypeFile(), "locator", "pool",
attributes, true);
editXMLFile(getSystemProperty("cache-xml-file"), "locator", "pool", attributes, true);
}

logger.info("Set locator for AppServer install to " + address + "[" + port + "]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ public TomcatInstall(TomcatVersion version, TomcatConfig config, String installD

// Get tomcat module path
tomcatModulePath = findAndExtractModule(GEODE_BUILD_HOME, "tomcat");
// Set the cache XML file by copying the XML file in the build dir
setCacheXMLFile(tomcatModulePath + "/conf/" + config.getXMLFile(),
"cargo_logs/XMLs/" + getContainerDescription() + "_" + System.nanoTime() + ".xml");

// Default properties
setCacheProperty("enableLocalCache", "false");

Expand All @@ -200,17 +204,6 @@ public TomcatInstall(TomcatVersion version, TomcatConfig config, String installD
}
}

/**
* Sets the XML file to use for cache settings
*
* Calls {@link ContainerInstall#setCacheXMLFile(String, String)} with the default original cache
* file located in the conf folder of the {@link #tomcatModulePath} and the given newXMLFilePath.
*/
@Override
public void setupCacheXMLFile(String newXMLFilePath) throws IOException {
super.setCacheXMLFile(tomcatModulePath + "/conf/" + config.getXMLFile(), newXMLFilePath);
}

/**
* Copies jars specified by {@link #tomcatRequiredJars} from the {@link #tomcatModulePath} and the
* specified other directory passed to the function.
Expand Down Expand Up @@ -353,7 +346,7 @@ public void writeProperties() throws Exception {
*
* For Client Server installations the cache-client.xml file is updated within the installations
* conf folder. For Peer to Peer installations the server.xml file is updated using
* {@link #updateXMLFiles()}.
* {@link #updateXMLFiles()} when the container is started.
*/
@Override
public void setLocator(String address, int port) throws Exception {
Expand All @@ -362,8 +355,7 @@ public void setLocator(String address, int port) throws Exception {
attributes.put("host", address);
attributes.put("port", Integer.toString(port));

editXMLFile(tomcatModulePath + "/conf/" + config.getXMLFile(), "locator", "pool", attributes,
true);
editXMLFile(getSystemProperty("cache-xml-file"), "locator", "pool", attributes, true);

} else {
setSystemProperty("locators", address + "[" + port + "]");
Expand Down

0 comments on commit aeeab24

Please sign in to comment.