Add EntitySpecs.spec(Class) - Use EntitySpecs.spec() instead of BasicEntitySpec.newInstance()
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/48bfc933 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/48bfc933 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/48bfc933 Branch: refs/heads/0.5.0 Commit: 48bfc933d9fb546bfc954c8c251f5cfe3e0ab9e2 Parents: 17c6173 Author: Aled Sage <[email protected]> Authored: Wed Mar 20 22:20:18 2013 +0000 Committer: Aled Sage <[email protected]> Committed: Thu Mar 21 10:33:56 2013 +0000 ---------------------------------------------------------------------- docs/start/walkthrough/index.md | 10 +++++----- 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 | 8 ++++---- docs/use/examples/whirrhadoop/whirrhadoop.include.md | 4 ++-- docs/use/guide/defining-applications/basic-concepts.md | 2 +- .../example_files/tomcat_multi-location.java | 6 +++--- .../defining-applications/example_files/tomcat_nginx.java | 6 +++--- .../example_files/tomcat_simple.java | 2 +- 10 files changed, 26 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/48bfc933/docs/start/walkthrough/index.md ---------------------------------------------------------------------- diff --git a/docs/start/walkthrough/index.md b/docs/start/walkthrough/index.md index b1614e7..d898d88 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(BasicEntitySpec.newInstance(MySqlNode.class)); - ControlledDynamicWebAppCluster web = createChild(BasicEntitySpec.newInstance(ControlledDynamicWebAppCluster.class)); + MySqlNode mysql = createChild(EntitySpecs.spec(MySqlNode.class)); + ControlledDynamicWebAppCluster web = createChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class)); } } {% endhighlight %} @@ -77,11 +77,11 @@ block "at the last moment" when the value is needed {% highlight java %} public class WebClusterDatabaseExample extends ApplicationBuilder { protected void doBuild() { - MySqlNode mysql = createChild(BasicEntitySpec.newInstance(MySqlNode.class) + MySqlNode mysql = createChild(EntitySpecs.spec(MySqlNode.class) .configure(MySqlNode.CREATION_SCRIPT_URL, "classpath://visitors-database-setup.sql")); - ControlledDynamicWebAppCluster web = createChild(BasicEntitySpec.newInstance(ControlledDynamicWebAppCluster.class) - .configure("memberSpec", BasicEntitySpec.newInstance(JBoss7Server.class) + ControlledDynamicWebAppCluster web = createChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class) + .configure("memberSpec", EntitySpecs.spec(JBoss7Server.class) .configure("httpPort", "8080+") .configure("war", WAR_PATH) .configure(javaSysProp("brooklyn.example.db.url"), http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/48bfc933/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 b67503c..1ffb30b 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(BasicEntitySpec.newInstance(DynamicFabric.class) + DynamicFabric webFabric = createChild(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(BasicEntitySpec.newInstance(DynamicFabric.class) + DynamicFabric webFabric = createChild(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(BasicEntitySpec.newInstance(GeoscalingDnsService.class) + GeoscalingDnsService geoDns = createChild(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/48bfc933/docs/use/examples/messaging/index.md ---------------------------------------------------------------------- diff --git a/docs/use/examples/messaging/index.md b/docs/use/examples/messaging/index.md index 9b3f5e7..09c3c9c 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(BasicEntitySpec.newInstance(QpidBroker.class) + QpidBroker broker = createChild(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(BasicEntitySpec.newInstance(QpidBroker.class) + QpidBroker broker = createChild(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(BasicEntitySpec.newInstance(QpidBroker.class) + QpidBroker broker = createChild(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/48bfc933/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 52d2546..a484c62 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(BasicEntitySpec.newInstance(MovableElasticWebAppCluster.class) + createChild(EntitySpecs.spec(MovableElasticWebAppCluster.class) .configure("war", WAR_FILE_URL)); {% endhighlight %} http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/48bfc933/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 723958a..6538f28 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(BasicEntitySpec.newInstance(JBoss7Server.class) + createChild(EntitySpecs.spec(JBoss7Server.class) .configure("war", WAR_PATH) .configure("httpPort", 8080)); } @@ -85,11 +85,11 @@ public class WebClusterDatabaseExample extends ApplicationBuilder { public static final String DB_PASSWORD = "br00k11n"; protected void doBuild() { - MySqlNode mysql = createChild(BasicEntitySpec.newInstance(MySqlNode.class) + MySqlNode mysql = createChild(EntitySpecs.spec(MySqlNode.class) .configure("creationScriptUrl", DB_SETUP_SQL_URL)); - ControlledDynamicWebAppCluster web = createChild(BasicEntitySpec.newInstance(ControlledDynamicWebAppCluster.class) - .configure("memberSpec", BasicEntitySpec.newInstance(JBoss7Server.class) + ControlledDynamicWebAppCluster web = createChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class) + .configure("memberSpec", EntitySpecs.spec(JBoss7Server.class) .configure("httpPort", "8080+") .configure("war", WAR_PATH) .configure(javaSysProp("brooklyn.example.db.url"), http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/48bfc933/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 21bb7e6..b053994 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(BasicEntitySpec.newInstance(WhirrHadoopCluster.class) + WhirrCluster cluster = createChild(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(BasicEntitySpec.newInstance(WhirrCluster.class) + WhirrCluster cluster = createChild(EntitySpecs.spec(WhirrCluster.class) .configure("recipe", RECIPE)); } } http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/48bfc933/docs/use/guide/defining-applications/basic-concepts.md ---------------------------------------------------------------------- diff --git a/docs/use/guide/defining-applications/basic-concepts.md b/docs/use/guide/defining-applications/basic-concepts.md index b14e2d2..ebc3c07 100644 --- a/docs/use/guide/defining-applications/basic-concepts.md +++ b/docs/use/guide/defining-applications/basic-concepts.md @@ -71,7 +71,7 @@ There is also an ``entity.setConfig(KEY, VALUE)`` method. Additionally, many common configuration parameters are available as "flags" which can be supplied as Strings when constructing then entity, in the form -``BasicEntitySpec.newInstance(MyEntity.class).configure("config1", "value1").configure("config2", "value2")``. +``EntitySpecs.specË(MyEntity.class).configure("config1", "value1").configure("config2", "value2")``. Documentation of the flags available for individual entities can normally be found in the javadocs. The ``@SetFromFlag`` annotations on ``ConfigKey`` static field definitions http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/48bfc933/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 d9d0325..beb3a9a 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,13 +2,13 @@ public class TomcatFabricApp extends ApplicationBuilder { @Override protected void doBuild() { - createChild(BasicEntitySpec.newInstance(DynamicFabric.class) + createChild(EntitySpecs.spec(DynamicFabric.class) .configure("displayName", "WebFabric") .configure("displayNamePrefix", "") .configure("displayNameSuffix", " web cluster") - .configure("memberSpec", BasicEntitySpec.newInstance(ControlledDynamicWebAppCluster.class) + .configure("memberSpec", EntitySpecs.spec(ControlledDynamicWebAppCluster.class) .configure("initialSize", 2) - .configure("memberSpec", : BasicEntitySpec.newInstance(TomcatServer.class) + .configure("memberSpec", : EntitySpecs.spec(TomcatServer.class) .configure("httpPort", "8080+") .configure("war", "/path/to/booking-mvc.war")))); } http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/48bfc933/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 5fc5589..a6b0776 100644 --- a/docs/use/guide/defining-applications/example_files/tomcat_nginx.java +++ b/docs/use/guide/defining-applications/example_files/tomcat_nginx.java @@ -2,14 +2,14 @@ public class TomcatClusterWithNginxApp extends ApplicationBuilder { @Override protected void doBuild() { - createChild(BasicEntitySpec.newInstance(NginxController.class) + createChild(EntitySpecs.spec(NginxController.class) .configure("domain", "brooklyn.geopaas.org") .configure("port", "8000+") .configure("portNumberSensor", Attributes.HTTP_PORT)); - createChild(BasicEntitySpec.newInstance(ControlledDynamicWebAppCluster.class) + createChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class) .configure("controller", nginxController) - .configure("memberSpec", : BasicEntitySpec.newInstance(TomcatServer.class) + .configure("memberSpec", : EntitySpecs.spec(TomcatServer.class) .configure("httpPort", "8080+") .configure("war", "/path/to/booking-mvc.war")) .configure("initialSize", 2)); http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/48bfc933/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 fbcc376..f7e51cb 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(BasicEntitySpec.newInstance(TomcatServer.class) + createChild(EntitySpecs.spec(TomcatServer.class) .configure("httpPort", "8080+") .configure("war", "/path/to/booking-mvc.war"))); }
