tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r441484 - in /tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status: JkBalancerMember.java JkStatusParser.java JkStatusTask.java JkStatusUpdateTask.java
Date Fri, 08 Sep 2006 12:23:51 GMT
Author: pero
Date: Fri Sep  8 05:23:50 2006
New Revision: 441484

URL: http://svn.apache.org/viewvc?view=rev&rev=441484
Log:
Add new mod_jk 1.2.19 status and update attributes.

Modified:
    tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkBalancerMember.java
    tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusParser.java
    tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusTask.java
    tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusUpdateTask.java

Modified: tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkBalancerMember.java
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkBalancerMember.java?view=diff&rev=441484&r1=441483&r2=441484
==============================================================================
--- tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkBalancerMember.java
(original)
+++ tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkBalancerMember.java
Fri Sep  8 05:23:50 2006
@@ -22,12 +22,19 @@
  * @version $Revision:$ $Date:$
  * @see org.apache.jk.status.JkStatusParser
  */
+/**
+ * @author peter
+ *
+ */
 public class JkBalancerMember implements Serializable {
     
     int id;
 
     String name;
 
+    /* possible with > 1.2.16 */
+    String jvm_route;
+
     String type;
 
     String host;
@@ -36,12 +43,22 @@
 
     String address;
 
+    /* deprecated with mod_jk 1.2.16*/
     String status;
+    
+    /* possible with > 1.2.16 */
+    String activation; 
 
+    /* possible with > 1.2.16 */
+    String state; 
+        
     int lbfactor;
 
     long lbvalue;
 
+    /* possible with > 1.2.16 */
+    long lbmult = -1 ;
+    
     int elected;
 
     long readed;
@@ -50,12 +67,36 @@
 
     long errors;
 
+    long clienterrors = -1;
+    
     int busy;
-
+    
+    /* possible with > 1.2.16 */
+    int maxbusy = -1;
+    
     String redirect;
     
     String domain;
     
+    /* possible with > 1.2.16 */
+    int distance = -1;
+
+    /**
+     * @return Returns the jvm_route.
+     * @since mod_jk 1.2.19
+     */
+    public String getJvm_route() {
+        return jvm_route;
+    }
+
+    /**
+     * @param jvm_route The jvm_route to set.
+     * @since mod_jk 1.2.19
+     */
+    public void setJvm_route(String jvm_route) {
+        this.jvm_route = jvm_route;
+    }
+
     /**
      * @return Returns the address.
      */
@@ -86,6 +127,23 @@
         this.busy = busy;
     }
 
+
+    /**
+     * @return Returns the maxbusy.
+     * @since mod_jk 1.2.18
+     */
+    public int getMaxbusy() {
+        return maxbusy;
+    }
+
+    /**
+     * @param maxbusy The maxbusy to set.
+     * @since mod_jk 1.2.18
+     */
+    public void setMaxbusy(int maxbusy) {
+        this.maxbusy = maxbusy;
+    }
+
     /**
      * @return Returns the elected.
      */
@@ -102,6 +160,22 @@
     }
 
     /**
+     * @return Returns the clienterrors.
+     * @since mod_jk 1.2.19
+     */
+    public long getClienterrors() {
+        return clienterrors;
+    }
+
+    /**
+     * @param clienterrors The clienterrors to set.
+     * @since mod_jk 1.2.19
+     */
+    public void setClienterrors(long clienterrors) {
+        this.clienterrors = clienterrors;
+    }
+
+    /**
      * @return Returns the errors.
      */
     public long getErrors() {
@@ -175,6 +249,22 @@
     public void setLbvalue(long lbvalue) {
         this.lbvalue = lbvalue;
     }
+    
+    /**
+     * @return Returns the lbmult.
+     * @since mod_jk 1.2.19
+     */
+    public long getLbmult() {
+        return lbmult;
+    }
+
+    /**
+     * @param lbmult The lbmult to set.
+     * @since mod_jk 1.2.19
+     */
+    public void setLbmult(long lbmult) {
+        this.lbmult = lbmult;
+    }
 
     /**
      * @return Returns the name.
@@ -191,6 +281,7 @@
         this.name = name;
     }
 
+
     /**
      * @return Returns the port.
      */
@@ -223,6 +314,7 @@
 
     /**
      * @return Returns the status.
+     * @deprecated since 1.2.16
      */
     public String getStatus() {
         return status;
@@ -231,12 +323,45 @@
     /**
      * @param status
      *            The status to set.
+     * @deprecated since 1.2.16
      */
     public void setStatus(String status) {
         this.status = status;
     }
 
     /**
+     * @return Returns the activation.
+     * @since mod_jk 1.2.19
+     */
+    public String getActivation() {
+        return activation;
+    }
+
+    /**
+     * @param activation The activation to set.
+     * @since mod_jk 1.2.19
+     */
+    public void setActivation(String activation) {
+        this.activation = activation;
+    }
+
+    /**
+     * @return Returns the state.
+     * @since mod_jk 1.2.19
+     */
+    public String getState() {
+        return state;
+    }
+
+    /**
+     * @param state The state to set.
+     * @since mod_jk 1.2.19
+     */
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    /**
      * @return Returns the transferred.
      */
     public long getTransferred() {
@@ -279,6 +404,7 @@
     public void setDomain(String domain) {
         this.domain = domain;
     }
+ 
     /**
      * @return Returns the redirect.
      */
@@ -291,4 +417,22 @@
     public void setRedirect(String redirect) {
         this.redirect = redirect;
     }
+
+    /**
+     * @return Returns the distance.
+     * @since mod_jk 1.2.18
+     */
+    public int getDistance() {
+        return distance;
+    }
+
+    /**
+     * @param distance The distance to set.
+     * @since mod_jk 1.2.18
+     */
+    public void setDistance(int distance) {
+        this.distance = distance;
+    }
+
+
 }

Modified: tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusParser.java
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusParser.java?view=diff&rev=441484&r1=441483&r2=441484
==============================================================================
--- tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusParser.java
(original)
+++ tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusParser.java
Fri Sep  8 05:23:50 2006
@@ -21,29 +21,21 @@
 
 /**
  * <code>
- *  &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
- *  &lt;jk:status xmlns:jk="http://jakarta.apache.org"&gt;
- *     &lt;jk:server name="localhost" port="80" 
- *                software="Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g mod_jk/1.2.13-dev"

- *                version="1.2.12"/&gt;
- *
- *	  &lt;jk:balancers&gt;
  *
- *        &lt;jk:balancer id="0" name="lb" type="lb" 
- *                      sticky="True" stickyforce="False" retries="3" recover="60"&gt;
- *            &lt;jk:member id="0" name="node1" type="ajp13" host="localhost" port="9012"

- *                       address="127.0.0.1:9012" status="OK" lbfactor="1" lbvalue="1"
- *                       elected="0" readed="0" transferred="0" errors="0" busy="0"/&gt;
- *            &lt;jk:member id="1" name="node2" type="ajp13" host="localhost" port="9022"
- *                       address="127.0.0.1:9022" status="OK" lbfactor="1" lbvalue="1" 
- *                       elected="0" readed="0" transferred="0" errors="0" busy="0"/&gt;
- *            &lt;jk:map type="Wildchar" uri="/ClusterTest/*" context="/ClusterTest/*"/&gt;
- *            &lt;jk:map type="Exact" uri="/ClusterTest" context="/ClusterTest"/&gt;
- *            &lt;jk:map type="Wildchar" uri="/myapps/*" context="/myapps/*"/&gt;
- *            &lt;jk:map type="Exact" uri="/myapps" context="/myapps"/&gt;
- *        &lt;/jk:balancer&gt;
- *     &lt;/jk:balancers&gt;
+ *  &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
+ *  &lt;jk:status xmlns:jk="http://tomcat.apache.org"&gt;
+ *    &lt;jk:server name="localhost" port="2010" software="Apache/2.0.58 (Unix) mod_jk/1.2.19-dev"
version="1.2.19" /&gt;
+ *    &lt;jk:balancers&gt;
+ *    &lt;jk:balancer id="0" name="loadbalancer" type="lb" sticky="True" stickyforce="False"
retries="2" recover="60" &gt;
+ *        &lt;jk:member id="0" name="node01" type="ajp13" host="localhost" port="20012"
address="127.0.0.1:20012" activation="ACT" state="N/A" distance="0" lbfactor="1" lbmult="1"
lbvalue="0" elected="0" errors="0" transferred="0" readed="0" busy="0" maxbusy="0" jvm_route="node01"
/&gt;
+ *        &lt;jk:member id="1" name="node02" type="ajp13" host="localhost" port="20022"
address="127.0.0.1:20022" activation="ACT" state="N/A" distance="0" lbfactor="1" lbmult="1"
lbvalue="0" elected="0" errors="0" transferred="0" readed="0" busy="0" maxbusy="0" jvm_route="node02"
/&gt;
+ *      &lt;jk:map type="Wildchar" uri="/ClusterSession*" context="/ClusterSession*"
/&gt;
+ *      &lt;jk:map type="Wildchar" uri="/ClusterTest*" context="/ClusterTest*" /&gt;
+ *      &lt;jk:map type="Wildchar" uri="/test*" context="/test*" /&gt;
+ *    &lt;/jk:balancer&gt;
+ *    &lt;/jk:balancers&gt;
  *  &lt;/jk:status&gt;
+ *
  * </code>
  * @author Peter Rossbach
  * @version $Revision:$ $Date:$
@@ -55,7 +47,18 @@
     /**
      * The descriptive information about this implementation.
      */
-    protected static final String info = "org.apache.jk.status.JkStatusParser/1.0";
+    private static final String info = "org.apache.jk.status.JkStatusParser/1.1";
+
+    /**
+     * Return descriptive information about this implementation and the
+     * corresponding version number, in the format
+     * <code>&lt;description&gt;/&lt;version&gt;</code>.
+     */
+    public String getInfo() {
+
+        return (info);
+
+    }
 
     /**
      * The <code>Digester</code> instance used to parse registry descriptors.

Modified: tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusTask.java
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusTask.java?view=diff&rev=441484&r1=441483&r2=441484
==============================================================================
--- tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusTask.java (original)
+++ tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusTask.java Fri
Sep  8 05:23:50 2006
@@ -22,6 +22,7 @@
 import org.apache.catalina.ant.BaseRedirectorHelperTask;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
 
 /**
  * Ant task that implements the show <code>/jkstatus</code> command, supported
@@ -34,6 +35,11 @@
 public class JkStatusTask extends BaseRedirectorHelperTask {
 
     /**
+     * The descriptive information about this implementation.
+     */
+    private static final String info = "org.apache.jk.status.JkStatusTask/1.1";
+
+    /**
      * Store status as <code>resultProperty</code> prefix.
      */
     protected String resultproperty;
@@ -64,6 +70,17 @@
 
     private String loadbalancer;
 
+    /**
+     * Return descriptive information about this implementation and the
+     * corresponding version number, in the format
+     * <code>&lt;description&gt;/&lt;version&gt;</code>.
+     */
+    public String getInfo() {
+
+        return (info);
+
+    }
+
     public String getPassword() {
         return (this.password);
     }
@@ -214,11 +231,16 @@
                                 setPropertyWorker(balancerIndex, member);
                             }
                             echoWorker(member);
-                            if (!"OK".equals(member.getStatus())) {
+                            if (member.getStatus() != null && !"OK".equals(member.getStatus()))
{
                                 error.append(" worker name=" + member.getName()
                                         + " status=" + member.getStatus()
                                         + " host=" + member.getAddress());
                             }
+                            if (member.getState() != null && !("OK".equals(member.getState())
|| "N/A".equals(member.getState())) ){
+                                error.append(" worker name=" + member.getName()
+                                        + " state=" + member.getState()
+                                        + " host=" + member.getAddress());
+                            }
                         }
                     }
                     if (!isWorkerOnly) {
@@ -297,8 +319,19 @@
      */
     private void echoWorker(JkBalancerMember member) {
         if (isEcho()) {
-            handleOutput("worker name=" + member.getName() + " status="
-                    + member.getStatus() + " host=" + member.getAddress());
+            StringBuffer state = new StringBuffer("worker name=") ;
+            state.append( member.getName()) ;
+            if(member.getStatus() != null) {
+                state.append(" status=");
+                state.append(member.getStatus());
+            }
+            if(member.getState() != null) {
+                state.append(" state=");
+                state.append(member.getState())  ;
+            }
+            state.append(" host=");
+            state.append(member.getAddress());
+            handleOutput(state.toString());
         }
     }
 
@@ -356,24 +389,49 @@
         createProperty(member, balancerIndex, workerIndex, "host");
         createProperty(member, balancerIndex, workerIndex, "port");
         createProperty(member, balancerIndex, workerIndex, "address");
-        createProperty(member, balancerIndex, workerIndex, "status");
+        if(member.getJvm_route() != null) {
+            createProperty(member, balancerIndex, workerIndex, "jvm_route");
+        }
+        if(member.getStatus() != null) {
+            createProperty(member, balancerIndex, workerIndex, "status");
+        }
+        if(member.getActivation() != null) {
+            createProperty(member, balancerIndex, workerIndex, "activation");
+        }
+        if(member.getState() != null) {
+            createProperty(member, balancerIndex, workerIndex, "state");
+        }
         createProperty(member, balancerIndex, workerIndex, "lbfactor");
         createProperty(member, balancerIndex, workerIndex, "lbvalue");
+        if(member.getLbmult() > 0) {
+            createProperty(member, balancerIndex, workerIndex, "lbmult");
+        }
         createProperty(member, balancerIndex, workerIndex, "elected");
         createProperty(member, balancerIndex, workerIndex, "readed");
         createProperty(member, balancerIndex, workerIndex, "busy");
+        if(member.getMaxbusy() > 0) {
+            createProperty(member, balancerIndex, workerIndex, "maxbusy");
+        }
         createProperty(member, balancerIndex, workerIndex, "transferred");
         createProperty(member, balancerIndex, workerIndex, "errors");
-        if (member.getDomain() != null)
+        if(member.getClienterrors() > 0) {
+            createProperty(member, balancerIndex, workerIndex, "clienterrors");
+        }
+        if(member.getDistance() > 0) {
+            createProperty(member, balancerIndex, workerIndex, "distance");
+        }
+        if (member.getDomain() != null) {
             createProperty(member, balancerIndex, workerIndex, "domain");
-        else
+        } else {
             getProject().setNewProperty(resultproperty + ".balancer." + balancerIndex + ".member."
+ workerIndex +
                     ".domain", "");          
-        if (member.getRedirect() != null)
+        }
+        if (member.getRedirect() != null) {
             createProperty(member, balancerIndex, workerIndex, "redirect");
-        else
+        } else {
             getProject().setNewProperty(resultproperty + ".balancer." + balancerIndex + ".member."
+ workerIndex +
                     ".redirect", "");          
+        }
     }
 
     /**
@@ -383,45 +441,74 @@
     private void setPropertyWorkerOnly(JkBalancer balancer,
             JkBalancerMember member) {
         String prefix = resultproperty + "." + member.getName();
-        getProject().setNewProperty(prefix + ".lb.id",
+        Project currentProject = getProject();
+        
+        currentProject.setNewProperty(prefix + ".lb.id",
                 Integer.toString(balancer.getId()));
-        getProject().setNewProperty(prefix + ".lb.name", balancer.getName());
-        getProject().setNewProperty(prefix + ".id",
+        currentProject.setNewProperty(prefix + ".lb.name", balancer.getName());
+        currentProject.setNewProperty(prefix + ".id",
                 Integer.toString(member.getId()));
-        getProject().setNewProperty(prefix + ".type", member.getType());
-        getProject().setNewProperty(prefix + ".status", member.getStatus());
-        getProject().setNewProperty(prefix + ".host", member.getHost());
-        getProject().setNewProperty(prefix + ".address", member.getAddress());
-        getProject().setNewProperty(prefix + ".port",
+        currentProject.setNewProperty(prefix + ".type", member.getType());
+        if(member.getJvm_route() != null) {
+            currentProject.setNewProperty(prefix + ".jvm_route", member.getJvm_route());
+        }
+        if(member.getStatus() != null) {
+            currentProject.setNewProperty(prefix + ".status", member.getStatus());
+        }
+        if(member.getActivation() != null) {
+            currentProject.setNewProperty(prefix + ".activation", member.getActivation());
+        }
+        if(member.getState() != null) {
+            currentProject.setNewProperty(prefix + ".state", member.getState());
+        }
+        currentProject.setNewProperty(prefix + ".host", member.getHost());
+        currentProject.setNewProperty(prefix + ".address", member.getAddress());
+        currentProject.setNewProperty(prefix + ".port",
                 Integer.toString(member.getPort()));
-        getProject().setNewProperty(prefix + ".lbfactor",
+        currentProject.setNewProperty(prefix + ".lbfactor",
                 Integer.toString(member.getLbfactor()));
-        getProject().setNewProperty(prefix + ".lbvalue",
+        currentProject.setNewProperty(prefix + ".lbvalue",
                 Long.toString(member.getLbvalue()));
-        getProject().setNewProperty(prefix + ".elected",
+        if(member.getLbmult() > 0) {
+            currentProject.setNewProperty(prefix + ".lbmult",
+                    Long.toString(member.getLbmult()));
+        }
+        currentProject.setNewProperty(prefix + ".elected",
                 Long.toString(member.getElected()));
-        getProject().setNewProperty(prefix + ".readed",
+        currentProject.setNewProperty(prefix + ".readed",
                 Long.toString(member.getReaded()));
-        getProject().setNewProperty(prefix + ".transferred",
+        currentProject.setNewProperty(prefix + ".transferred",
                 Long.toString(member.getTransferred()));
-        getProject().setNewProperty(prefix + ".busy",
+        currentProject.setNewProperty(prefix + ".busy",
                 Integer.toString(member.getBusy()));
-        getProject().setNewProperty(prefix + ".errors",
+        if(member.getMaxbusy() > 0) {
+            currentProject.setNewProperty(prefix + ".maxbusy",
+                    Long.toString(member.getMaxbusy()));
+        }
+        currentProject.setNewProperty(prefix + ".errors",
                 Long.toString(member.getErrors()));
+        if(member.getClienterrors() > 0) {
+            currentProject.setNewProperty(prefix + ".clienterrors",
+                    Long.toString(member.getClienterrors()));
+        }
+        if(member.getDistance() > 0) {
+            currentProject.setNewProperty(prefix + ".distance",
+                    Integer.toString(member.getDistance()));
+        }
         if (member.getDomain() != null)
-            getProject().setNewProperty(prefix + ".domain", member.getDomain());
+            currentProject.setNewProperty(prefix + ".domain", member.getDomain());
         else
-            getProject().setNewProperty(prefix + ".domain", "");
+            currentProject.setNewProperty(prefix + ".domain", "");
         if (member.getRedirect() != null)
-            getProject().setNewProperty(prefix + ".redirect",
+            currentProject.setNewProperty(prefix + ".redirect",
                     member.getRedirect());
         else
-            getProject().setNewProperty(prefix + ".redirect", "");
+            currentProject.setNewProperty(prefix + ".redirect", "");
             
     }
 
     /*
-     * (non-Javadoc)
+     * Set ant property for save error state
      * 
      * @see org.apache.catalina.ant.BaseRedirectorHelperTask#setErrorProperty(java.lang.String)
      */

Modified: tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusUpdateTask.java
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusUpdateTask.java?view=diff&rev=441484&r1=441483&r2=441484
==============================================================================
--- tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusUpdateTask.java
(original)
+++ tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/JkStatusUpdateTask.java
Fri Sep  8 05:23:50 2006
@@ -26,12 +26,18 @@
  * Ant task that implements the <code>/status</code> command, supported by the
  * mod_jk status (1.2.13) application.
  * 
+ * 
  * @author Peter Rossbach
  * @version $Revision: 1.3 $
  * @since 5.5.10
  */
 public class JkStatusUpdateTask extends AbstractCatalinaTask {
 
+    /**
+     * The descriptive information about this implementation.
+     */
+    private static final String info = "org.apache.jk.status.JkStatusUpdateTask/1.1";
+
     private String worker = "lb";
 
     private String workerType = "lb";
@@ -48,19 +54,38 @@
 
     private Integer workerLoadFactor;
 
+    private String workerJvmRoute ;
+    
+    private int workerDistance = -1;
+    
     private String workerRedirect;
 
     private String workerClusterDomain;
 
-    private Boolean workerDisabled = Boolean.FALSE;
+    private Boolean workerDisabled ;
 
-    private Boolean workerStopped = Boolean.FALSE;
+    private Boolean workerStopped ;
     
+    private int workerActivation = -1;
+      
     private boolean isLBMode = true;
+    
+    
 
     private String workerLb;
 
     /**
+     * Return descriptive information about this implementation and the
+     * corresponding version number, in the format
+     * <code>&lt;description&gt;/&lt;version&gt;</code>.
+     */
+    public String getInfo() {
+
+        return (info);
+
+    }
+    
+    /**
      *  
      */
     public JkStatusUpdateTask() {
@@ -69,6 +94,34 @@
     }
 
     /**
+     * @return Returns the workerDistance.
+     */
+    public int getWorkerDistance() {
+        return workerDistance;
+    }
+
+    /**
+     * @param workerDistance The workerDistance to set.
+     */
+    public void setWorkerDistance(int workerDistance) {
+        this.workerDistance = workerDistance;
+    }
+
+    /**
+     * @return Returns the workerJvmRoute.
+     */
+    public String getWorkerJvmRoute() {
+        return workerJvmRoute;
+    }
+
+    /**
+     * @param workerJvmRoute The workerJvmRoute to set.
+     */
+    public void setWorkerJvmRoute(String workerJvmRoute) {
+        this.workerJvmRoute = workerJvmRoute;
+    }
+
+    /**
      * @return Returns the internalid.
      */
     public int getInternalid() {
@@ -219,6 +272,26 @@
     }
 
     /**
+     * @return Returns the workerActivation.
+     */
+    public int getWorkerActivation() {
+        return workerActivation;
+    }
+    
+    /**
+     * <ul>
+     * <li>1 active</li>
+     * <li>2 disabled</li>
+     * <li>3 stopped</li>
+     * </ul>
+     * @param workerActivation The workerActivation to set.
+     * 
+     */
+    public void setWorkerActivation(int workerActivation) {
+        this.workerActivation = workerActivation;
+    }
+    
+    /**
      * @return Returns the workerStopped.
      */
     public Boolean getWorkerStopped() {
@@ -283,10 +356,29 @@
      * <li><b>load balance example:
      * </b>http://localhost/jkstatus?cmd=update&mime=txt&w=lb&lf=false&ls=true</li>
      * <li><b>worker example:
-     * </b>http://localhost/jkstatus?cmd=update&mime=txt&w=node1&l=lb&wf=1&wd=false&ws=false
+     * </b>http://localhost/jkstatus?cmd=update&mime=txt&w=node1&wn=node01&l=lb&wf=1&wa=1&wx=0
+     * <br/
+     * <ul>
+     * <li>wa=1 activation</li>
+     * <li>wa=2 disabled</li>
+     * <li>wa=3 stopped</li>
+     * </ul>
      * </li>
      * </ul>
      * 
+     * <ul>
+     * <li><b>w:<b/> name tcp worker node</li>
+     * <li><b>l:<b/> name loadbalancer</li>
+     * <li><b>wf:<b/> load factor</li>
+     * <li><b>wn:<b/> jvm route</li>
+     * <li><b>wx:<b/> distance</li>
+     * <li><b>wa:<b/> activation state</li>
+     * <li><b>wr:<b/> redirect route</li>
+     * <li><b>wd:<b/> cluster domain</li>
+     * <li><b>ws:<b/> stopped deprecated 1.2.16</li>
+     * <li><b>wd:<b/> disabled deprecated 1.2.16</li>
+     * </ul>
+     * 
      * @return create jkstatus link
      */
     private StringBuffer createLink() {
@@ -317,26 +409,40 @@
                 }
             } else {
                 //http://localhost/status?cmd=update&mime=txt&w=node1&l=lb&wf=1&wd=false&ws=false
-                if ((workerLb != null)) { // must be configured
+                if (workerLb != null) { // must be configured
                     sb.append("&l=");
                     sb.append(URLEncoder.encode(workerLb, getCharset()));
                 }
-                if ((workerLoadFactor != null)) { // >= 1
+                if (workerLoadFactor != null) { // >= 1
                     sb.append("&wf=");
                     sb.append(workerLoadFactor);
                 }
-                if ((workerDisabled != null)) {
+                if (workerJvmRoute != null) {
+                    sb.append("&wn=");
+                    sb.append(URLEncoder.encode(workerJvmRoute, getCharset()));
+                } 
+                if (workerDisabled != null) {
                     sb.append("&wd=");
                     sb.append(workerDisabled);
                 }
-                if ((workerStopped != null)) {
+                if (workerStopped != null) {
                     sb.append("&ws=");
                     sb.append(workerStopped);
                 }
-                if ((workerRedirect != null)) { // other worker conrecte lb's
+                if (workerActivation > 0 && workerActivation < 4) {
+                    sb.append("&wa=");
+                    sb.append(workerActivation);
+                } 
+                if (workerDistance >= 0) {
+                    sb.append("&wx=");
+                    sb.append(workerDistance);
+                }
+                if (workerRedirect != null) { // other worker conrecte lb's
                     sb.append("&wr=");
+                    sb.append(URLEncoder.encode(workerRedirect,
+                            getCharset()));
                 }
-                if ((workerClusterDomain != null)) {
+                if (workerClusterDomain != null) {
                     sb.append("&wc=");
                     sb.append(URLEncoder.encode(workerClusterDomain,
                             getCharset()));
@@ -380,14 +486,6 @@
             }
             isLBMode = true;
         } else if ("worker".equals(workerType)) {
-            if (workerDisabled == null) {
-                throw new BuildException(
-                        "Must specify at a node worker 'workerDisabled' attribute");
-            }
-            if (workerStopped == null) {
-                throw new BuildException(
-                        "Must specify at a node worker 'workerStopped' attribute");
-            }
             if (workerLoadFactor == null ) {
                 throw new BuildException(
                         "Must specify at a node worker 'workerLoadFactor' attribute");



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message