brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [10/50] brooklyn-library git commit: Override AbstractApplication.init()
Date Mon, 01 Feb 2016 17:46:28 GMT
Override AbstractApplication.init()

- AbstractApplication.init() logs warning that the method will be
  most likely be deprecated in a future release.
- Override init() in sub-classes.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/23a5c988
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/23a5c988
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/23a5c988

Branch: refs/heads/0.5.0
Commit: 23a5c988559482705aaacc795eb7e325cabea19c
Parents: 3c0588c
Author: Aled Sage <aled.sage@gmail.com>
Authored: Thu Mar 28 14:52:48 2013 +0000
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Fri Mar 29 09:37:57 2013 +0000

----------------------------------------------------------------------
 .../main/java/brooklyn/demo/WebClusterDatabaseExampleApp.java | 4 ----
 .../java/brooklyn/web/console/test/TestApplication.groovy     | 5 +++++
 .../src/test/java/brooklyn/entity/webapp/JBossExample.groovy  | 7 ++++++-
 3 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/23a5c988/examples/simple-web-cluster/src/main/java/brooklyn/demo/WebClusterDatabaseExampleApp.java
----------------------------------------------------------------------
diff --git a/examples/simple-web-cluster/src/main/java/brooklyn/demo/WebClusterDatabaseExampleApp.java
b/examples/simple-web-cluster/src/main/java/brooklyn/demo/WebClusterDatabaseExampleApp.java
index 898a410..df88bb9 100644
--- a/examples/simple-web-cluster/src/main/java/brooklyn/demo/WebClusterDatabaseExampleApp.java
+++ b/examples/simple-web-cluster/src/main/java/brooklyn/demo/WebClusterDatabaseExampleApp.java
@@ -17,7 +17,6 @@ import brooklyn.enricher.basic.SensorPropagatingEnricher;
 import brooklyn.enricher.basic.SensorTransformingEnricher;
 import brooklyn.entity.basic.AbstractApplication;
 import brooklyn.entity.basic.Entities;
-import brooklyn.entity.basic.EntityLocal;
 import brooklyn.entity.basic.StartableApplication;
 import brooklyn.entity.database.mysql.MySqlNode;
 import brooklyn.entity.group.DynamicCluster;
@@ -35,7 +34,6 @@ import brooklyn.launcher.BrooklynLauncher;
 import brooklyn.location.basic.PortRanges;
 import brooklyn.policy.autoscaling.AutoScalerPolicy;
 import brooklyn.util.CommandLineUtil;
-import brooklyn.util.text.StringFunctions;
 
 import com.google.common.base.Functions;
 import com.google.common.collect.Lists;
@@ -91,8 +89,6 @@ public class WebClusterDatabaseExampleApp extends AbstractApplication implements
 
     @Override
     public void init() {
-        super.init();
-
         MySqlNode mysql = addChild(
                 EntitySpecs.spec(MySqlNode.class)
                         .configure(MySqlNode.CREATION_SCRIPT_URL, getConfig(DB_SETUP_SQL_URL)));

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/23a5c988/sandbox/web-acceptance/src/test/java/brooklyn/web/console/test/TestApplication.groovy
----------------------------------------------------------------------
diff --git a/sandbox/web-acceptance/src/test/java/brooklyn/web/console/test/TestApplication.groovy
b/sandbox/web-acceptance/src/test/java/brooklyn/web/console/test/TestApplication.groovy
index 08285ff..046756b 100644
--- a/sandbox/web-acceptance/src/test/java/brooklyn/web/console/test/TestApplication.groovy
+++ b/sandbox/web-acceptance/src/test/java/brooklyn/web/console/test/TestApplication.groovy
@@ -60,6 +60,11 @@ class TestApplication extends AbstractApplication {
         setAttribute(CHILDREN, getChildren().size())
     }
 
+    @Override
+    public void init() {
+        // no-op
+    }
+
     public <T> Task<T> invoke(Effector<T> eff, Map<String, ?> parameters)
{
         return null  //To change body of implemented methods use File | Settings | File Templates.
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/23a5c988/software/webapp/src/test/java/brooklyn/entity/webapp/JBossExample.groovy
----------------------------------------------------------------------
diff --git a/software/webapp/src/test/java/brooklyn/entity/webapp/JBossExample.groovy b/software/webapp/src/test/java/brooklyn/entity/webapp/JBossExample.groovy
index 2b4dc4e..253463c 100644
--- a/software/webapp/src/test/java/brooklyn/entity/webapp/JBossExample.groovy
+++ b/software/webapp/src/test/java/brooklyn/entity/webapp/JBossExample.groovy
@@ -14,8 +14,13 @@ import brooklyn.location.basic.LocalhostMachineProvisioningLocation
 @Deprecated
 class JBossExample extends AbstractApplication {
 
-    JBoss7Server s = new JBoss7ServerImpl(this, httpPort: "8080+", war:"classpath://hello-world.war");
+    JBoss7Server s;
     
+    @Override
+    public void init() {
+        s = new JBoss7ServerImpl(this, httpPort: "8080+", war:"classpath://hello-world.war");
+    }
+
     public static void main(String[] args) {
         def ex = new JBossExample();
         ex.start( [ new LocalhostMachineProvisioningLocation(name:'london') ] )


Mime
View raw message