_extra/simple_java_examples/example_files/tomcat_multi-location.java (14 lines of code) (raw):
// TODO Untested code; see brooklyn-example for better maintained examples!
public class TomcatFabricApp extends AbstractApplication {
@Override
public void init() {
addChild(EntitySpec.create(DynamicFabric.class)
.configure("displayName", "WebFabric")
.configure("displayNamePrefix", "")
.configure("displayNameSuffix", " web cluster")
.configure("dynamiccluster.memberspec", EntitySpec.create(ControlledDynamicWebAppCluster.class)
.configure("cluster.initial.size", 2)
.configure("dynamiccluster.memberspec", : EntitySpec.create(TomcatServer.class)
.configure("httpPort", "8080+")
.configure("war", "/path/to/booking-mvc.war"))));
}
}