brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [44/50] brooklyn-server git commit: Fix lifecycle docs (about annotated methods being called)
Date Mon, 01 Feb 2016 17:49:14 GMT
Fix lifecycle docs (about annotated methods being called)

- Deprecate the annotations
- Correct the lifecycle javadoc


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

Branch: refs/heads/0.4.0
Commit: ca55de1e50a57cb0ff7c3a1784de1c943f03ca29
Parents: dafa3e9
Author: Aled Sage <aled.sage@gmail.com>
Authored: Mon Jan 7 16:54:13 2013 +0000
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Mon Jan 7 17:11:53 2013 +0000

----------------------------------------------------------------------
 .../main/java/brooklyn/entity/basic/Create.java |  4 +++
 .../java/brooklyn/entity/basic/Destroy.java     |  4 +++
 .../main/java/brooklyn/entity/basic/Error.java  |  4 +++
 .../java/brooklyn/entity/basic/Lifecycle.java   | 32 +++++++++-----------
 .../java/brooklyn/entity/basic/PostStart.java   |  4 +++
 .../java/brooklyn/entity/basic/PreStart.java    |  4 +++
 .../java/brooklyn/entity/basic/PreStop.java     |  4 +++
 7 files changed, 39 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ca55de1e/core/src/main/java/brooklyn/entity/basic/Create.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/Create.java b/core/src/main/java/brooklyn/entity/basic/Create.java
index 16e2c6e..1f7b385 100644
--- a/core/src/main/java/brooklyn/entity/basic/Create.java
+++ b/core/src/main/java/brooklyn/entity/basic/Create.java
@@ -5,6 +5,10 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+/**
+ * @deprecated This annotation had no effect; deprecated in brooklyn 0.4.0.
+ */
+@Deprecated
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.PARAMETER)
 public @interface Create {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ca55de1e/core/src/main/java/brooklyn/entity/basic/Destroy.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/Destroy.java b/core/src/main/java/brooklyn/entity/basic/Destroy.java
index 1e9e1c3..0db6da6 100644
--- a/core/src/main/java/brooklyn/entity/basic/Destroy.java
+++ b/core/src/main/java/brooklyn/entity/basic/Destroy.java
@@ -5,6 +5,10 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+/**
+ * @deprecated This annotation had no effect; deprecated in brooklyn 0.4.0.
+ */
+@Deprecated
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.PARAMETER)
 public @interface Destroy {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ca55de1e/core/src/main/java/brooklyn/entity/basic/Error.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/Error.java b/core/src/main/java/brooklyn/entity/basic/Error.java
index 3ed884d..ae857e5 100644
--- a/core/src/main/java/brooklyn/entity/basic/Error.java
+++ b/core/src/main/java/brooklyn/entity/basic/Error.java
@@ -5,6 +5,10 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+/**
+ * @deprecated This annotation had no effect; deprecated in brooklyn 0.4.0.
+ */
+@Deprecated
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.PARAMETER)
 public @interface Error {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ca55de1e/core/src/main/java/brooklyn/entity/basic/Lifecycle.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/Lifecycle.java b/core/src/main/java/brooklyn/entity/basic/Lifecycle.java
index d738b4d..b0a92c9 100644
--- a/core/src/main/java/brooklyn/entity/basic/Lifecycle.java
+++ b/core/src/main/java/brooklyn/entity/basic/Lifecycle.java
@@ -8,16 +8,16 @@ import com.google.common.base.CaseFormat;
  * @startuml img/entity-lifecycle.png
  * title Entity Lifecycle
  *
- * (*) ->  [ @Create ]     "CREATED"
+ * (*) ->  "CREATED"
  *     if "Exception" then
- *     ->  [ @Error ]      "ON_FIRE"
+ *     ->  "ON_FIRE"
  *     else
- *     --> [ @PreStart ]   "STARTING"
- *     -->                 "RUNNING"
- *     ->  [ @PreStop ]    "STOPPING"
- *     --> [ @PostStop ]   "STOPPED"
- *     -->                 "RUNNING"
- *     --> [ @Destroy ]    "DESTROYED"
+ *     --> "STARTING"
+ *     --> "RUNNING"
+ *     ->  "STOPPING"
+ *     --> "STOPPED"
+ *     --> "RUNNING"
+ *     --> "DESTROYED"
  *     -left-> (*)
  * @enduml
  */
@@ -25,7 +25,7 @@ public enum Lifecycle {
     /**
      * The entity has just been created.
      *
-     * This stage encompasses the contructors and any methods annotated as {@link brooklyn.entity.basic.Create}.
Once this stage is
+     * This stage encompasses the contruction. Once this stage is
      * complete, the basic set of {@link brooklyn.event.Sensor}s will be available, apart
from any that require the entity to be active or
      * deployed to a {@link brooklyn.location.Location}.
      */
@@ -34,8 +34,8 @@ public enum Lifecycle {
     /**
      * The entity is starting.
      *
-     * This stage is entered when the {@link brooklyn.entity.trait.Startable#START} {@link
brooklyn.entity.Effector} is called. Any methods annotated
-     * as {@link brooklyn.entity.basic.PreStart} are run, and the entity will have its location
set and and setup helper object created.
+     * This stage is entered when the {@link brooklyn.entity.trait.Startable#START} {@link
brooklyn.entity.Effector} is called. 
+     * The entity will have its location set and and setup helper object created.
      */
     STARTING,
 
@@ -50,9 +50,8 @@ public enum Lifecycle {
     /**
      * The entity is stopping.
      *
-     * This stage is activated when the {@link brooklyn.entity.trait.Startable#STOP} effector
is called. The entity service is stopped, and any
-     * methods annotated as {@link brooklyn.entity.basic.PreStop} or {@link brooklyn.entity.basic.PostStop}
are called as appropriate. Sensors that provide data
-     * from the running entity should be cleared and subscriptions cancelled.
+     * This stage is activated when the {@link brooklyn.entity.trait.Startable#STOP} effector
is called. The entity service is stopped. 
+     * Sensors that provide data from the running entity may be cleared and subscriptions
cancelled.
      */
     STOPPING,
 
@@ -67,8 +66,7 @@ public enum Lifecycle {
     /**
      * The entity is destroyed.
      *
-     * Any methods annotated as {@link brooklyn.entity.basic.Destroy} will be run to clear
up entity state and resources. The entity will then be
-     * unmanaged and removed from any groups and its parent.
+     * The entity will be unmanaged and removed from any groups and from its parent.
      */
     DESTROYED,
 
@@ -76,7 +74,7 @@ public enum Lifecycle {
      * Entity error state.
      *
      * This stage is reachable from any other stage if an error occurs or an exception is
thrown. It is not generally possible
-     * to recover from this state, but any {@link brooklyn.entity.basic.Error} annotated
methods will be run to provide feedback or housekeeping.
+     * to recover from this state.
      */
     ON_FIRE;
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ca55de1e/core/src/main/java/brooklyn/entity/basic/PostStart.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/PostStart.java b/core/src/main/java/brooklyn/entity/basic/PostStart.java
index 3d04787..a1e68f1 100644
--- a/core/src/main/java/brooklyn/entity/basic/PostStart.java
+++ b/core/src/main/java/brooklyn/entity/basic/PostStart.java
@@ -6,6 +6,10 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+/**
+ * @deprecated This annotation had no effect; deprecated in brooklyn 0.4.0.
+ */
+@Deprecated
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.PARAMETER)
 public @interface PostStart {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ca55de1e/core/src/main/java/brooklyn/entity/basic/PreStart.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/PreStart.java b/core/src/main/java/brooklyn/entity/basic/PreStart.java
index 564cbd6..d69144f 100644
--- a/core/src/main/java/brooklyn/entity/basic/PreStart.java
+++ b/core/src/main/java/brooklyn/entity/basic/PreStart.java
@@ -5,6 +5,10 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+/**
+ * @deprecated This annotation had no effect; deprecated in brooklyn 0.4.0.
+ */
+@Deprecated
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.PARAMETER)
 public @interface PreStart {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ca55de1e/core/src/main/java/brooklyn/entity/basic/PreStop.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/PreStop.java b/core/src/main/java/brooklyn/entity/basic/PreStop.java
index 94e3880..dbcd367 100644
--- a/core/src/main/java/brooklyn/entity/basic/PreStop.java
+++ b/core/src/main/java/brooklyn/entity/basic/PreStop.java
@@ -5,6 +5,10 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+/**
+ * @deprecated This annotation had no effect; deprecated in brooklyn 0.4.0.
+ */
+@Deprecated
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.PARAMETER)
 public @interface PreStop {


Mime
View raw message