You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ch...@apache.org on 2013/05/17 15:17:58 UTC

svn commit: r1483788 - in /uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common: AServicePing.java ServiceStatistics.java

Author: challngr
Date: Fri May 17 13:17:58 2013
New Revision: 1483788

URL: http://svn.apache.org/r1483788
Log:
UIMA-2919 Update javadoc for Custom Ping API

Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/AServicePing.java
    uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/ServiceStatistics.java

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/AServicePing.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/AServicePing.java?rev=1483788&r1=1483787&r2=1483788&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/AServicePing.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/AServicePing.java Fri May 17 13:17:58 2013
@@ -35,6 +35,8 @@ public abstract class AServicePing
 
     /**
      * Returns the object with application-derived health and statistics.
+     * @return {@link ServiceStatistcs} This object contains the informaton the service manager and web server require
+     *     for correct management and display of the service.
      */
     public abstract ServiceStatistics getStatistics();
     

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/ServiceStatistics.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/ServiceStatistics.java?rev=1483788&r1=1483787&r2=1483788&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/ServiceStatistics.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/ServiceStatistics.java Fri May 17 13:17:58 2013
@@ -2,6 +2,10 @@ package org.apache.uima.ducc.common;
 
 import java.io.Serializable;
 
+/**
+ * The ServiceStatics class is used to return service health, availability, and monitoring statistics
+ * to the Service Manager.
+ */
 public class  ServiceStatistics
     implements Serializable
 {
@@ -11,6 +15,20 @@ public class  ServiceStatistics
     private String info = "N/A";
     private String errorString = null;
 
+    /**
+     * Consstructor
+     *
+     * @param alive This indicates whether the service is responsive to the pinger.  Set to "true" if so, and
+     *              to false otherwise.  If set "false", the Service Manager assumes the service is not
+     *              available and will not allow new work dependent on it to start.
+     *
+     * @param healthy This indicates whether the service is responding adequately.  This is purely subjective,
+     *                and is determined by each individul ping implementation.  The information is used
+     *                only for display in the web server.
+     *
+     * @param info This is a string containing monitoring information about the service.  It is used only
+     *             for display in the web server.
+     */
     public ServiceStatistics(boolean alive, boolean healthy, String info)
     {
         this.alive = alive;
@@ -18,40 +36,54 @@ public class  ServiceStatistics
         this.info = info;
     }
 
+    /**
+     * Query whether the service is alive.
+     * @return "true" if the service is responsive, "false" otherwise.
+     */
     public boolean isAlive()   { return alive; }            // is the service active and functioning ?
+
+    /**
+     * Query wether the service is "healthy".
+     * @return "true" if the service is healthy, "false" otherwise.
+     */
     public boolean isHealthy() { return healthy; }          // is the service healthy ?
+
+    /**
+     * Return service statistics, if any.
+     * @return A string containing information regarding the service.  This is used only for display in the web server.
+     */
     public String  getInfo()   { return info; }             // additional service-specific information
 
     /**
-     * If there were problems, this returns a string for some sort of presentation or logging.
-     *
-     * Be sure to update this to null if the object is reused after returning errors.
+     * Set the "aliveness" of the service.  This is called by each pinger for each service.
+     * @param alive Set to "true" if the service is responseve, "false" otherwise.
      */
-    public String getErrorString()
-    {
-        return errorString;
-    }
-    
     public void setAlive(boolean alive)
     {
         this.alive = alive;
     }
-
-    public void setHealthy(boolean healthy)
+ 
+    /**
+     * Set the "health" of the service.  This is called by each pinger for each service.
+     * @param alive Set to "true" if the service is healthy, "false" otherwise.
+     */
+   public void setHealthy(boolean healthy)
     {
         this.healthy = healthy;
     }
 
+    /**
+     * Set the monitor statistics for the service.  This is called by each pinger for each service.
+     * @param info This is an arbitrary string summarizing the service's performance.  This is used only in the web serverl
+     */
     public void setInfo(String info)
     {
         this.info = info;
     }
 
-    public void setErrorString(String err)
-    {
-        this.errorString = err;
-    }
-
+    /**
+     * A simple formatter for the class
+     */
     public String toString()
     {
         if ( errorString == null ) {