Rename ApplicationBuilder.createChild to addChild - Adds ApplicationBuilder.addChild(EntitySpec) and ApplicationBuilder.addChild(Map, Class) - Deprecates the old createChild methods - Updates all uses
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/3392164e Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/3392164e Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/3392164e Branch: refs/heads/0.5.0 Commit: 3392164e97b23e2fb92cc51bf34d39246a7e6f2b Parents: 48bfc93 Author: Aled Sage <[email protected]> Authored: Thu Mar 21 14:23:03 2013 +0000 Committer: Aled Sage <[email protected]> Committed: Thu Mar 21 17:41:37 2013 +0000 ---------------------------------------------------------------------- docs/start/walkthrough/index.md | 8 ++++---- docs/use/examples/global-web-fabric/index.md | 6 +++--- docs/use/examples/messaging/index.md | 6 +++--- docs/use/examples/portable-cloudfoundry/index.md | 2 +- docs/use/examples/webcluster/webcluster.include.md | 6 +++--- docs/use/examples/whirrhadoop/whirrhadoop.include.md | 4 ++-- .../example_files/tomcat_multi-location.java | 2 +- .../defining-applications/example_files/tomcat_nginx.java | 4 ++-- .../defining-applications/example_files/tomcat_simple.java | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/3392164e/docs/start/walkthrough/index.md ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/index.md b/docs/start/walkthrough/index.md index d898d88..3d96234 100644 --- a/docs/start/walkthrough/index.md +++ b/docs/start/walkthrough/index.md @@ -21,8 +21,8 @@ for management: {% highlight java %} public class WebClusterDatabaseExample extends ApplicationBuilder { protected void doBuild() { - MySqlNode mysql = createChild(EntitySpecs.spec(MySqlNode.class)); - ControlledDynamicWebAppCluster web = createChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class)); + MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class)); + ControlledDynamicWebAppCluster web = addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class)); } } {% endhighlight %} @@ -77,10 +77,10 @@ block "at the last moment" when the value is needed {% highlight java %} public class WebClusterDatabaseExample extends ApplicationBuilder { protected void doBuild() { - MySqlNode mysql = createChild(EntitySpecs.spec(MySqlNode.class) + MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class) .configure(MySqlNode.CREATION_SCRIPT_URL, "classpath://visitors-database-setup.sql")); - ControlledDynamicWebAppCluster web = createChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class) + ControlledDynamicWebAppCluster web = addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class) .configure("memberSpec", EntitySpecs.spec(JBoss7Server.class) .configure("httpPort", "8080+") .configure("war", WAR_PATH) http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/3392164e/docs/use/examples/global-web-fabric/index.md ---------------------------------------------------------------------- diff --git a/docs/use/examples/global-web-fabric/index.md b/docs/use/examples/global-web-fabric/index.md index 1ffb30b..43401cb 100644 --- a/docs/use/examples/global-web-fabric/index.md +++ b/docs/use/examples/global-web-fabric/index.md @@ -121,7 +121,7 @@ or perhaps a `CloudFoundryJavaWebAppCluster` if deploying to a Cloud Foundry loc (see below). {% highlight java %} - DynamicFabric webFabric = createChild(EntitySpecs.spec(DynamicFabric.class) + DynamicFabric webFabric = addChild(EntitySpecs.spec(DynamicFabric.class) .displayName("Web Fabric") .configure(DynamicFabric.FACTORY, new ElasticJavaWebAppService.Factory()) .configure(ElasticJavaWebAppService.ROOT_WAR, WAR_PATH)); @@ -143,7 +143,7 @@ First, however, let's make sure any load-balancer proxies (e.g. nginx) in these are listening on port 80: {% highlight java %} - DynamicFabric webFabric = createChild(EntitySpecs.spec(DynamicFabric.class) + DynamicFabric webFabric = addChild(EntitySpecs.spec(DynamicFabric.class) .displayName("Web Fabric") .configure(DynamicFabric.FACTORY, new ElasticJavaWebAppService.Factory()) .configure(ElasticJavaWebAppService.ROOT_WAR, WAR_PATH) @@ -160,7 +160,7 @@ from confusing us -- e.g. `brooklyn-1234.yourname.geopaas.org`. {% highlight java %} StringConfigMap config = getManagementContext().getConfig(); - GeoscalingDnsService geoDns = createChild(EntitySpecs.spec(GeoscalingDnsService.class) + GeoscalingDnsService geoDns = addChild(EntitySpecs.spec(GeoscalingDnsService.class) .displayName("GeoScaling DNS") .configure("username", checkNotNull(config.getFirst("brooklyn.geoscaling.username"), "username")) .configure("password", checkNotNull(config.getFirst("brooklyn.geoscaling.password"), "password")) http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/3392164e/docs/use/examples/messaging/index.md ---------------------------------------------------------------------- diff --git a/docs/use/examples/messaging/index.md b/docs/use/examples/messaging/index.md index 09c3c9c..2944b03 100644 --- a/docs/use/examples/messaging/index.md +++ b/docs/use/examples/messaging/index.md @@ -44,7 +44,7 @@ no queues or topics: public class StandaloneBrokerExample extends ApplicationBuilder { protected void doBuild() { // Configure the Qpid broker entity - QpidBroker broker = createChild(EntitySpecs.spec(QpidBroker.class) + QpidBroker broker = addChild(EntitySpecs.spec(QpidBroker.class) .configure("amqpPort", 5672)); } } @@ -62,7 +62,7 @@ file: final String CUSTOM_CONFIG_PATH = "classpath://custom-config.xml"; final String PASSWD_PATH = "classpath://passwd"; - QpidBroker broker = createChild(EntitySpecs.spec(QpidBroker.class) + QpidBroker broker = addChild(EntitySpecs.spec(QpidBroker.class) .configure("amqpPort", 5672) .configure("amqpVersion", AmqpServer.AMQP_0_10) .configure("runtimeFiles", ImmutableMap.builder() @@ -82,7 +82,7 @@ on startup. final String QPID_BDBSTORE_JAR_PATH = "classpath://qpid-bdbstore-0.14.jar"; final String BDBSTORE_JAR_PATH = "classpath://je-5.0.34.jar"; - QpidBroker broker = createChild(EntitySpecs.spec(QpidBroker.class) + QpidBroker broker = addChild(EntitySpecs.spec(QpidBroker.class) .configure("amqpPort", 5672) .configure("amqpVersion", AmqpServer.AMQP_0_10) .configure("runtimeFiles", ImmutableMap.builder() http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/3392164e/docs/use/examples/portable-cloudfoundry/index.md ---------------------------------------------------------------------- diff --git a/docs/use/examples/portable-cloudfoundry/index.md b/docs/use/examples/portable-cloudfoundry/index.md index a484c62..31ac0fa 100644 --- a/docs/use/examples/portable-cloudfoundry/index.md +++ b/docs/use/examples/portable-cloudfoundry/index.md @@ -182,7 +182,7 @@ This means we could run our new entity by changing one line in the (although of course ``move`` will throw an exception): {% highlight java %} - createChild(EntitySpecs.spec(MovableElasticWebAppCluster.class) + addChild(EntitySpecs.spec(MovableElasticWebAppCluster.class) .configure("war", WAR_FILE_URL)); {% endhighlight %} http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/3392164e/docs/use/examples/webcluster/webcluster.include.md ---------------------------------------------------------------------- diff --git a/docs/use/examples/webcluster/webcluster.include.md b/docs/use/examples/webcluster/webcluster.include.md index 6538f28..fec490d 100644 --- a/docs/use/examples/webcluster/webcluster.include.md +++ b/docs/use/examples/webcluster/webcluster.include.md @@ -29,7 +29,7 @@ public class SingleWebServerExample extends ApplicationBuilder { @Override protected void doBuild() { - createChild(EntitySpecs.spec(JBoss7Server.class) + addChild(EntitySpecs.spec(JBoss7Server.class) .configure("war", WAR_PATH) .configure("httpPort", 8080)); } @@ -85,10 +85,10 @@ public class WebClusterDatabaseExample extends ApplicationBuilder { public static final String DB_PASSWORD = "br00k11n"; protected void doBuild() { - MySqlNode mysql = createChild(EntitySpecs.spec(MySqlNode.class) + MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class) .configure("creationScriptUrl", DB_SETUP_SQL_URL)); - ControlledDynamicWebAppCluster web = createChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class) + ControlledDynamicWebAppCluster web = addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class) .configure("memberSpec", EntitySpecs.spec(JBoss7Server.class) .configure("httpPort", "8080+") .configure("war", WAR_PATH) http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/3392164e/docs/use/examples/whirrhadoop/whirrhadoop.include.md ---------------------------------------------------------------------- diff --git a/docs/use/examples/whirrhadoop/whirrhadoop.include.md b/docs/use/examples/whirrhadoop/whirrhadoop.include.md index b053994..63f0682 100644 --- a/docs/use/examples/whirrhadoop/whirrhadoop.include.md +++ b/docs/use/examples/whirrhadoop/whirrhadoop.include.md @@ -35,7 +35,7 @@ with an arbitrary size, using the ``WhirrHadoopCluster`` entity. public class WhirrHadoopExample extends ApplicationBuilder { @Override protected void doBuild() { - WhirrCluster cluster = createChild(EntitySpecs.spec(WhirrHadoopCluster.class) + WhirrCluster cluster = addChild(EntitySpecs.spec(WhirrHadoopCluster.class) .configure("size", 2) .configure("memory", 2048)); } @@ -72,7 +72,7 @@ public class WhirrExample extends ApplicationBuilder { "whirr.instance-templates=1 noop, 1 elasticsearch"+"\n"; protected void doBuild() { - WhirrCluster cluster = createChild(EntitySpecs.spec(WhirrCluster.class) + WhirrCluster cluster = addChild(EntitySpecs.spec(WhirrCluster.class) .configure("recipe", RECIPE)); } } http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/3392164e/docs/use/guide/defining-applications/example_files/tomcat_multi-location.java ---------------------------------------------------------------------- diff --git a/docs/use/guide/defining-applications/example_files/tomcat_multi-location.java b/docs/use/guide/defining-applications/example_files/tomcat_multi-location.java index beb3a9a..90191bd 100644 --- a/docs/use/guide/defining-applications/example_files/tomcat_multi-location.java +++ b/docs/use/guide/defining-applications/example_files/tomcat_multi-location.java @@ -2,7 +2,7 @@ public class TomcatFabricApp extends ApplicationBuilder { @Override protected void doBuild() { - createChild(EntitySpecs.spec(DynamicFabric.class) + addChild(EntitySpecs.spec(DynamicFabric.class) .configure("displayName", "WebFabric") .configure("displayNamePrefix", "") .configure("displayNameSuffix", " web cluster") http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/3392164e/docs/use/guide/defining-applications/example_files/tomcat_nginx.java ---------------------------------------------------------------------- diff --git a/docs/use/guide/defining-applications/example_files/tomcat_nginx.java b/docs/use/guide/defining-applications/example_files/tomcat_nginx.java index a6b0776..502ee37 100644 --- a/docs/use/guide/defining-applications/example_files/tomcat_nginx.java +++ b/docs/use/guide/defining-applications/example_files/tomcat_nginx.java @@ -2,12 +2,12 @@ public class TomcatClusterWithNginxApp extends ApplicationBuilder { @Override protected void doBuild() { - createChild(EntitySpecs.spec(NginxController.class) + addChild(EntitySpecs.spec(NginxController.class) .configure("domain", "brooklyn.geopaas.org") .configure("port", "8000+") .configure("portNumberSensor", Attributes.HTTP_PORT)); - createChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class) + addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class) .configure("controller", nginxController) .configure("memberSpec", : EntitySpecs.spec(TomcatServer.class) .configure("httpPort", "8080+") http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/3392164e/docs/use/guide/defining-applications/example_files/tomcat_simple.java ---------------------------------------------------------------------- diff --git a/docs/use/guide/defining-applications/example_files/tomcat_simple.java b/docs/use/guide/defining-applications/example_files/tomcat_simple.java index f7e51cb..4793b27 100644 --- a/docs/use/guide/defining-applications/example_files/tomcat_simple.java +++ b/docs/use/guide/defining-applications/example_files/tomcat_simple.java @@ -2,7 +2,7 @@ public class TomcatServerApp extends ApplicationBuilder { @Override protected void doBuild() { - createChild(EntitySpecs.spec(TomcatServer.class) + addChild(EntitySpecs.spec(TomcatServer.class) .configure("httpPort", "8080+") .configure("war", "/path/to/booking-mvc.war"))); }
