Merge pull request #643 from pveentjer/0.5.0-rc.1

0.5.0 rc.1
diff --git a/docs/start/known-issues.md b/docs/start/known-issues.md
index ee2523a..78393ab 100644
--- a/docs/start/known-issues.md
+++ b/docs/start/known-issues.md
@@ -20,7 +20,7 @@
 
 *Symptom: Brooklyn fails to provision Ubuntu 8 VMs (e.g. in aws-ec2) with the following error 'Cannot insert the iptables rule for port 22. Error: sudo: illegal option `-n''.
 
-*Cause: Ubuntu 8 is too old; the sudu command doesn't support the -n setting.
+*Cause: Ubuntu 8 is too old; the sudo command doesn't support the -n setting.
 
 *Workaround: Choose Ubuntu 10 or higher.
 
diff --git a/docs/start/walkthrough/index.md b/docs/start/walkthrough/index.md
index 3d96234..3e4bb28 100644
--- a/docs/start/walkthrough/index.md
+++ b/docs/start/walkthrough/index.md
@@ -19,8 +19,9 @@
 for management:
 
 {% highlight java %}
-public class WebClusterDatabaseExample extends ApplicationBuilder {
-    protected void doBuild() {
+public class WebClusterDatabaseExample extends AbstractApplication {
+    @Override
+    public void init() {
         MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class));
         ControlledDynamicWebAppCluster web = addChild(EntitySpecs.spec(ControlledDynamicWebAppCluster.class));
     }
@@ -75,8 +76,9 @@
 (but after e.g. the VMs have been provisioned, to speed things up).
 
 {% highlight java %}
-public class WebClusterDatabaseExample extends ApplicationBuilder {
-    protected void doBuild() {
+public class WebClusterDatabaseExample extends AbstractApplication {
+    @Override
+    public void init() {
         MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class)
                 .configure(MySqlNode.CREATION_SCRIPT_URL, "classpath://visitors-database-setup.sql"));
         
diff --git a/docs/use/examples/global-web-fabric/index.md b/docs/use/examples/global-web-fabric/index.md
index 43401cb..47e46d1 100644
--- a/docs/use/examples/global-web-fabric/index.md
+++ b/docs/use/examples/global-web-fabric/index.md
@@ -94,17 +94,18 @@
    and adds them as DNS targets for the region they are in  
 
 First, however, let's create the Java class -- call it `GlobalWebFabricExample`.
-This will extend the Brooklyn `ApplicationBuilder`:
+This will extend the Brooklyn `AbstractApplication`:
 
 {% highlight java %}
 package brooklyn.demo;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-import brooklyn.entity.basic.ApplicationBuilder;
+import brooklyn.entity.basic.AbstractApplication;
 
-public class GlobalWebFabricExample extends ApplicationBuilder {
-    protected void doBuild() {
-        // TODO create our app!
+public class GlobalWebFabricExample extends AbstractApplication {
+    @Override
+    public void init() {
+         // TODO create our app!
     }
 }
 {% endhighlight %}
@@ -223,7 +224,7 @@
 import org.slf4j.LoggerFactory;
 
 import brooklyn.config.StringConfigMap;
-import brooklyn.entity.basic.ApplicationBuilder;
+import brooklyn.entity.basic.AbstractApplication;
 import brooklyn.entity.basic.Attributes;
 import brooklyn.entity.dns.geoscaling.GeoscalingDnsService;
 import brooklyn.entity.group.DynamicFabric;
diff --git a/docs/use/examples/messaging/index.md b/docs/use/examples/messaging/index.md
index 2944b03..c5b448f 100644
--- a/docs/use/examples/messaging/index.md
+++ b/docs/use/examples/messaging/index.md
@@ -41,8 +41,9 @@
 no queues or topics:
 
 {% highlight java %}
-public class StandaloneBrokerExample extends ApplicationBuilder {
-    protected void doBuild() {
+public class StandaloneBrokerExample extends AbstractApplication {
+    @Override
+    public void init() {
         // Configure the Qpid broker entity
     	QpidBroker broker = addChild(EntitySpecs.spec(QpidBroker.class)
     	        .configure("amqpPort", 5672));
diff --git a/docs/use/examples/portable-cloudfoundry/index.md b/docs/use/examples/portable-cloudfoundry/index.md
index 31ac0fa..298df32 100644
--- a/docs/use/examples/portable-cloudfoundry/index.md
+++ b/docs/use/examples/portable-cloudfoundry/index.md
@@ -43,12 +43,12 @@
 We'll create our application in a Java class ``MovableCloudFoundryClusterExample``:
 
 {% highlight java %}
-public class MovableCloudFoundryClusterExample extends ApplicationBuilder {
+public class MovableCloudFoundryClusterExample extends AbstractApplication {
 
     public static final String WAR_FILE_URL = "classpath://hello-world-webapp.war";
 
     @Override
-    protected void doBuild() {
+    public void init() {
         // FIXME Code not supported; temporary situation while we update to new mechanism!
         // ElasticJavaWebAppService websvc = new ElasticWebAppService(MutableMap.of("war", WAR_FILE_URL), getApp());
     }
diff --git a/docs/use/examples/webcluster/webcluster.include.md b/docs/use/examples/webcluster/webcluster.include.md
index fec490d..1318514 100644
--- a/docs/use/examples/webcluster/webcluster.include.md
+++ b/docs/use/examples/webcluster/webcluster.include.md
@@ -24,11 +24,11 @@
 with a single line:
 
 {% highlight java %}
-public class SingleWebServerExample extends ApplicationBuilder {
+public class SingleWebServerExample extends AbstractApplication {
     private static final String WAR_PATH = "classpath://hello-world-webapp.war";
 
     @Override
-    protected void doBuild() {
+    public void init() {
         addChild(EntitySpecs.spec(JBoss7Server.class)
                 .configure("war", WAR_PATH)
                 .configure("httpPort", 8080));
@@ -75,7 +75,7 @@
 The essential code fragment looks like this:
 
 {% highlight java %}
-public class WebClusterDatabaseExample extends ApplicationBuilder {
+public class WebClusterDatabaseExample extends AbstractApplication {
     public static final String WAR_PATH = "classpath://hello-world-sql-webapp.war";
     
     public static final String DB_SETUP_SQL_URL = "classpath://visitors-creation-script.sql";
@@ -83,8 +83,9 @@
     public static final String DB_TABLE = "visitors";
     public static final String DB_USERNAME = "brooklyn";
     public static final String DB_PASSWORD = "br00k11n";
-    
-    protected void doBuild() {
+
+    @Override
+    public void init() {
         MySqlNode mysql = addChild(EntitySpecs.spec(MySqlNode.class)
                 .configure("creationScriptUrl", DB_SETUP_SQL_URL));
         
diff --git a/docs/use/examples/whirrhadoop/whirrhadoop.include.md b/docs/use/examples/whirrhadoop/whirrhadoop.include.md
index 63f0682..932299e 100644
--- a/docs/use/examples/whirrhadoop/whirrhadoop.include.md
+++ b/docs/use/examples/whirrhadoop/whirrhadoop.include.md
@@ -32,9 +32,9 @@
 with an arbitrary size, using the ``WhirrHadoopCluster`` entity.
 
 {% highlight java %}
-public class WhirrHadoopExample extends ApplicationBuilder {
+public class WhirrHadoopExample extends AbstractApplication {
     @Override
-    protected void doBuild() {
+    public void init() {
         WhirrCluster cluster = addChild(EntitySpecs.spec(WhirrHadoopCluster.class)
                 .configure("size", 2)
                 .configure("memory", 2048));
@@ -65,13 +65,14 @@
 can be run from within Brooklyn:
 
 {% highlight java %}
-public class WhirrExample extends ApplicationBuilder {
+public class WhirrExample extends AbstractApplication {
     public static final String RECIPE =
             "whirr.cluster-name=brooklyn-whirr"+"\n"+
             "whirr.hardware-min-ram=1024"+"\n"+
             "whirr.instance-templates=1 noop, 1 elasticsearch"+"\n";
 
-    protected void doBuild() {
+    @Override
+    public void init() {
         WhirrCluster cluster = addChild(EntitySpecs.spec(WhirrCluster.class)
                 .configure("recipe", RECIPE));
     }
diff --git a/docs/use/guide/defining-applications/basic-concepts.md b/docs/use/guide/defining-applications/basic-concepts.md
index ebc3c07..3e9a217 100644
--- a/docs/use/guide/defining-applications/basic-concepts.md
+++ b/docs/use/guide/defining-applications/basic-concepts.md
@@ -39,7 +39,7 @@
 
 Applications are typically defined in Brooklyn as an ***application descriptor***. 
 This is a Java class specifying the entities which make up the application,
-by extending the class ``ApplicationBuilder``, and specifying how these entities should be configured and managed.
+by extending the class ``AbstractApplication``, and specifying how these entities should be configured and managed.
 
 All entities, including applications, can be the parent of other entities. 
 This means that the "child" is typically started, configured, and managed by the parent.
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 90191bd..70d404f 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
@@ -1,7 +1,7 @@
 // TODO Untested code; see brooklyn-example for better maintained examples!
-public class TomcatFabricApp extends ApplicationBuilder {
+public class TomcatFabricApp extends AbstractApplication {
     @Override
-    protected void doBuild() {
+    public void init() {
         addChild(EntitySpecs.spec(DynamicFabric.class)
                 .configure("displayName", "WebFabric")
                 .configure("displayNamePrefix", "")
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 502ee37..cf76516 100644
--- a/docs/use/guide/defining-applications/example_files/tomcat_nginx.java
+++ b/docs/use/guide/defining-applications/example_files/tomcat_nginx.java
@@ -1,7 +1,7 @@
 // TODO Untested code; see brooklyn-example for better maintained examples!
-public class TomcatClusterWithNginxApp extends ApplicationBuilder {
+public class TomcatClusterWithNginxApp extends AbstractApplication {
     @Override
-    protected void doBuild() {
+    public void init() {
         addChild(EntitySpecs.spec(NginxController.class)
                 .configure("domain", "brooklyn.geopaas.org")
                 .configure("port", "8000+")
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 4793b27..4985454 100644
--- a/docs/use/guide/defining-applications/example_files/tomcat_simple.java
+++ b/docs/use/guide/defining-applications/example_files/tomcat_simple.java
@@ -1,7 +1,7 @@
 // TODO Untested code; see brooklyn-example for better maintained examples!
-public class TomcatServerApp extends ApplicationBuilder {
+public class TomcatServerApp extends AbstractApplication {
     @Override
-    protected void doBuild() {
+    public void init() {
         addChild(EntitySpecs.spec(TomcatServer.class)
                 .configure("httpPort", "8080+")
                 .configure("war", "/path/to/booking-mvc.war")));