option to remove the web server on the install

This commit is contained in:
Clebert Suconic 2015-05-20 16:58:53 -04:00
parent 14cb3a07a0
commit 4de929c3e1
4 changed files with 32 additions and 4 deletions

View File

@ -80,6 +80,7 @@ public class Create extends InputAbstract
public static final String ETC_CLUSTER_SECURITY_SETTINGS_TXT = "etc/cluster-security-settings.txt";
public static final String ETC_CLUSTER_SETTINGS_TXT = "etc/cluster-settings.txt";
public static final String ETC_CONNECTOR_SETTINGS_TXT = "etc/connector-settings.txt";
public static final String ETC_BOOTSTRAP_WEB_SETTINGS_TXT = "etc/bootstrap-web-settings.txt";
@Arguments(description = "The instance directory to hold the broker's configuration and data", required = true)
File directory;
@ -132,10 +133,23 @@ public class Create extends InputAbstract
@Option(name = "--role", description = "The name for the role created (Default: amq)")
String role;
@Option(name = "--no-web", description = "This will remove the web server definition from bootstrap.xml")
boolean noWeb;
boolean IS_WINDOWS;
boolean IS_CYGWIN;
public boolean isNoWeb()
{
return noWeb;
}
public void setNoWeb(boolean noWeb)
{
this.noWeb = noWeb;
}
public int getPortOffset()
{
return portOffset;
@ -500,6 +514,18 @@ public class Create extends InputAbstract
filters.put("${bootstrap.guest}", "");
}
if (noWeb)
{
filters.put("${bootstrap-web-settings}", "");
}
else
{
filters.put("${bootstrap-web-settings}", applyFilters(readTextFile(ETC_BOOTSTRAP_WEB_SETTINGS_TXT), filters));
}
write(ETC_BOOTSTRAP_XML, filters, false);
write(ETC_BROKER_XML, filters, false);
write(ETC_ARTEMIS_ROLES_PROPERTIES, filters, false);

View File

@ -0,0 +1,4 @@
<!-- The web server is only bound to loalhost by default -->
<web bind="http://localhost:${http.port}" path="web">
<app url="jolokia" war="jolokia-war-1.2.3.war"/>
</web>

View File

@ -25,10 +25,7 @@
<server configuration="file:${artemis.instance}/etc/broker.xml"/>
<!-- The web server is only bound to loalhost by default -->
<web bind="http://localhost:${http.port}" path="web">
<app url="jolokia" war="jolokia-war-1.2.3.war"/>
</web>
${bootstrap-web-settings}
</broker>

View File

@ -48,6 +48,7 @@ public class StreamClassPathTest
openStream(Create.ETC_CLUSTER_SECURITY_SETTINGS_TXT);
openStream(Create.ETC_CLUSTER_SETTINGS_TXT);
openStream(Create.ETC_CONNECTOR_SETTINGS_TXT);
openStream(Create.ETC_BOOTSTRAP_WEB_SETTINGS_TXT);
}