[jboss-cvs] JBossAS SVN: r76280 - in trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster: ha and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 28 00:22:59 EDT 2008


Author: bstansberry at jboss.com
Date: 2008-07-28 00:22:59 -0400 (Mon, 28 Jul 2008)
New Revision: 76280

Modified:
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/advertise/AdvertiseListener.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ha/ClusteredMCMPHandlerImpl.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/MCMPHandler.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/MCMPUtils.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/impl/DefaultMCMPHandler.java
Log:
[JBAS-5659] Fix startup initialization of proxies

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/advertise/AdvertiseListener.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/advertise/AdvertiseListener.java	2008-07-28 04:13:37 UTC (rev 76279)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/advertise/AdvertiseListener.java	2008-07-28 04:22:59 UTC (rev 76280)
@@ -38,6 +38,10 @@
 import java.util.HashMap;
 import java.util.Locale;
 
+import org.apache.catalina.util.StringManager;
+import org.jboss.logging.Logger;
+import org.jboss.web.tomcat.service.modcluster.Constants;
+import org.jboss.web.tomcat.service.modcluster.config.MCMPHandlerConfiguration;
 import org.jboss.web.tomcat.service.modcluster.mcmp.MCMPHandler;
 
 
@@ -56,6 +60,8 @@
      */
     public static String DEFAULT_GROUP     = "224.0.1.105";
 
+    private static final Logger log = Logger.getLogger(AdvertiseListener.class);
+    
     private static String RFC_822_FMT      = "EEE, d MMM yyyy HH:mm:ss Z";
     private int              advertisePort = DEFAULT_PORT;
     private String           groupAddress  = DEFAULT_GROUP;
@@ -74,6 +80,11 @@
 
     private     MCMPHandler commHandler;
     private     Thread          workerThread;
+    
+    /**
+     * The string manager for this package.
+     */
+    private StringManager sm = StringManager.getManager(Constants.Package);
 
 
     private static void digestString(MessageDigest md, String s)
@@ -99,6 +110,26 @@
         df = new SimpleDateFormat(RFC_822_FMT, Locale.US);
         servers = new HashMap<String, AdvertisedServer>();
         this.commHandler = commHandler;
+        
+        MCMPHandlerConfiguration config = commHandler.getConfiguration();
+           
+        if (config.getAdvertiseGroupAddress() != null) {
+            setGroupAddress(config.getAdvertiseGroupAddress());
+        }
+        if (config.getAdvertisePort() > 0) {
+            setAdvertisePort(config.getAdvertisePort());
+        }
+        try {
+            if (config.getAdvertiseSecurityKey() != null) {
+                setSecurityKey(config.getAdvertiseSecurityKey());
+            }
+            start();
+        } catch (IOException e) {
+            log.error(sm.getString("modcluster.error.startListener"), e);
+        } catch (NoSuchAlgorithmException e) {
+            // Should never happen
+            log.error(sm.getString("modcluster.error.startListener"), e);
+        }
     }
 
     /**

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ha/ClusteredMCMPHandlerImpl.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ha/ClusteredMCMPHandlerImpl.java	2008-07-28 04:13:37 UTC (rev 76279)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ha/ClusteredMCMPHandlerImpl.java	2008-07-28 04:22:59 UTC (rev 76280)
@@ -24,7 +24,6 @@
 
 import java.io.IOException;
 import java.net.InetAddress;
-import java.security.NoSuchAlgorithmException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -59,7 +58,7 @@
    private static final Class[] NULL_TYPES = new Class[0];
    private static final Class[] MCMPREQ_TYPES = new Class[] { MCMPRequest.class };
    private static final Class[] MCMPREQS_TYPES = new Class[] { List.class };
-   private static final Class[] DISC_EVENT_TYPES = new Class[] { MCMPServerDiscoveryEvent.class, int.class };
+   private static final Class[] DISC_EVENT_TYPES = new Class[] { MCMPServerDiscoveryEvent.class };
    
    private static final Logger log = Logger.getLogger(ClusteredMCMPHandlerImpl.class);
    
@@ -294,10 +293,23 @@
       }
    }
 
-   public void init()
-   {
-      this.localHandler.init();
-      startListener();
+   public void init(List<AddressPort> initialProxies)
+   {      
+      if (isMasterNode())
+      {
+         this.localHandler.init(initialProxies);
+      }
+      else
+      {
+         this.localHandler.init(new ArrayList<AddressPort>());
+         if (initialProxies != null)
+         {
+            for (AddressPort proxy : initialProxies)
+            {               
+               sendDiscoveryEventToPartition(proxy.address, proxy.port, true);
+            }
+         }
+      }      
    }
 
    public boolean isProxyHealthOK()
@@ -323,17 +335,14 @@
    public void markProxiesInError()
    {
       recordRequestFailure();
-   }
-
-   public void refresh()
-   {
+      
       if (isMasterNode())
       {
-         this.localHandler.refresh();
+         this.localHandler.markProxiesInError();
       }
       else
       {
-         GroupRpcResponse result = invokeNoArgGroupRpc("refresh");
+         GroupRpcResponse result = invokeNoArgGroupRpc("markProxiesInError");
          if (result instanceof ThrowableGroupRpcResponse)
          {
             throw ((ThrowableGroupRpcResponse) result).getValueAsRuntimeException();
@@ -417,7 +426,6 @@
 
    public void shutdown()
    {
-      stopListener();
       this.localHandler.shutdown();
    }
 
@@ -468,55 +476,8 @@
          throw Utils.convertToUnchecked(thrown);
          
       throw new IllegalStateException(sm.getString("modcluster.error.rpc.noresp", methodName));
-   }    
+   } 
    
-   /**
-    * Start the advertise listener.
-    */
-   private void startListener() 
-   {      
-      MCMPHandlerConfiguration handlerConfig = getConfiguration();
-      Boolean advertise = handlerConfig.getAdvertise();
-      if ((handlerConfig.getProxyList() == null && advertise == null)
-            || Boolean.TRUE.equals(advertise))
-      {      
-          this.advertiseListener = new AdvertiseListener(this);
-          if (handlerConfig.getAdvertiseGroupAddress() != null) {
-             this.advertiseListener.setGroupAddress(handlerConfig.getAdvertiseGroupAddress());
-          }
-          if (handlerConfig.getAdvertisePort() > 0) {
-             this.advertiseListener.setAdvertisePort(handlerConfig.getAdvertisePort());
-          }
-          try {
-              if (handlerConfig.getAdvertiseSecurityKey() != null) {
-                 this.advertiseListener.setSecurityKey(handlerConfig.getAdvertiseSecurityKey());
-              }
-              this.advertiseListener.start();
-          } catch (IOException e) {
-              log.error(sm.getString("modcluster.error.startListener"), e);
-          } catch (NoSuchAlgorithmException e) {
-              // Should never happen
-              log.error(sm.getString("modcluster.error.startListener"), e);
-          }
-      }
-   }
-   
-
-   /**
-    * Stop the advertise listener.
-    */
-   private void stopListener() 
-   {
-       if (this.advertiseListener != null) {
-           try {
-              this.advertiseListener.destroy();
-           } catch (IOException e) {
-               log.error(sm.getString("modcluster.error.stopListener"), e);
-           }
-           this.advertiseListener = null;
-       }
-   }
-   
    @SuppressWarnings("unchecked")
    private synchronized void sendDiscoveryEventToPartition(InetAddress address, int port, boolean addition)
    {

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/MCMPHandler.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/MCMPHandler.java	2008-07-28 04:13:37 UTC (rev 76279)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/MCMPHandler.java	2008-07-28 04:22:59 UTC (rev 76280)
@@ -40,8 +40,8 @@
    /** Gets this handler's configuration */
    MCMPHandlerConfiguration getConfiguration();
    
-   /** Initialize the handler */
-   void init();
+   /** Initialize the handler with the given list of proxies */
+   void init(List<AddressPort> initialProxies);
    
    /** Perform any shut down work. */
    void shutdown();
@@ -139,20 +139,9 @@
    void reset();
    
    /** 
-    * FIXME. This is the same as markProxiesInError().
-    * 
     * Reset any proxies whose status is {@link MCMPServerState#OK OK} down to 
     * {@link MCMPServerState#ERROR ERROR}, which will trigger a refresh of 
-    * their configuration. To be used through JMX or similar.
-    */
-   void refresh();
-   
-   /** 
-    * Reset any proxies whose status is {@link MCMPServerState#OK OK} down to 
-    * {@link MCMPServerState#ERROR ERROR}, which will trigger a refresh of 
     * their configuration.
-    * 
-    * FIXME. This is the same as refresh().
     */
    void markProxiesInError();   
    

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/MCMPUtils.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/MCMPUtils.java	2008-07-28 04:13:37 UTC (rev 76279)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/MCMPUtils.java	2008-07-28 04:22:59 UTC (rev 76280)
@@ -27,6 +27,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.StringTokenizer;
 
 import org.apache.catalina.Container;
 import org.apache.catalina.Context;
@@ -34,7 +35,10 @@
 import org.apache.catalina.Server;
 import org.apache.catalina.Service;
 import org.apache.catalina.connector.Connector;
+import org.apache.catalina.util.StringManager;
 import org.apache.tomcat.util.IntrospectionUtils;
+import org.jboss.logging.Logger;
+import org.jboss.web.tomcat.service.modcluster.Constants;
 import org.jboss.web.tomcat.service.modcluster.Utils;
 import org.jboss.web.tomcat.service.modcluster.config.BalancerConfiguration;
 import org.jboss.web.tomcat.service.modcluster.config.NodeConfiguration;
@@ -47,8 +51,18 @@
  */
 public class MCMPUtils
 {
+   public static final int DEFAULT_PORT = 8000;
+   
    private static final MCMPRequest INFO = new MCMPRequest(MCMPRequestType.INFO, false, new HashMap<String, String>());
    
+   private static final Logger log = Logger.getLogger(MCMPUtils.class);
+
+   /**
+    * The string manager for this package.
+    */
+   private static final StringManager sm = StringManager.getManager(Constants.Package);
+   
+   
    public static MCMPRequest createConfigRequest(Engine engine, NodeConfiguration nodeConfig, BalancerConfiguration balancerConfig)
    {
         Connector connector = Utils.findProxyConnector(engine.getService().findConnectors());
@@ -251,6 +265,42 @@
       return new AddressPort(address, port);
    }
    
+   public static List<AddressPort> parseProxies(String proxyList)   
+   {
+      List<AddressPort> proxies = new ArrayList<AddressPort>();
+      if (proxyList != null)
+      {         
+         StringTokenizer tok = new StringTokenizer(proxyList, ",");
+         while (tok.hasMoreTokens()) {
+            String token = tok.nextToken().trim();
+            int pos = token.indexOf(':');
+            String address = null;
+            int port = DEFAULT_PORT;
+            if (pos < 0) {
+               address = token;
+            } else if (pos == 0) {
+               address = null;
+               port = Integer.parseInt(token.substring(1));
+            } else {
+               address = token.substring(0, pos);
+               port = Integer.parseInt(token.substring(pos + 1));
+            }
+            InetAddress inetAddress = null;
+            try {
+               if (address != null) {
+                  inetAddress = InetAddress.getByName(address);
+               }
+            } catch (Exception e) {
+               log.error(sm.getString("modcluster.error.invalidHost", address), e);
+               continue;
+            }
+            proxies.add(new AddressPort(inetAddress, port));
+         }         
+      }
+      
+      return proxies;
+   }
+   
    /**
     * Disable external instantiation. 
     */

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/impl/DefaultMCMPHandler.java	2008-07-28 04:13:37 UTC (rev 76279)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/impl/DefaultMCMPHandler.java	2008-07-28 04:22:59 UTC (rev 76280)
@@ -30,8 +30,6 @@
 import java.io.Serializable;
 import java.net.InetAddress;
 import java.net.Socket;
-import java.net.UnknownHostException;
-import java.security.NoSuchAlgorithmException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -39,7 +37,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.StringTokenizer;
 
 import net.jcip.annotations.Immutable;
 
@@ -48,7 +45,6 @@
 import org.apache.tomcat.util.buf.UEncoder;
 import org.jboss.logging.Logger;
 import org.jboss.web.tomcat.service.modcluster.Constants;
-import org.jboss.web.tomcat.service.modcluster.advertise.AdvertiseListener;
 import org.jboss.web.tomcat.service.modcluster.config.MCMPHandlerConfiguration;
 import org.jboss.web.tomcat.service.modcluster.mcmp.AddressPort;
 import org.jboss.web.tomcat.service.modcluster.mcmp.MCMPHandler;
@@ -101,7 +97,7 @@
    /**
     * Proxies.
     */
-   private volatile Proxy[] proxies = null;
+   private volatile Proxy[] proxies = new Proxy[0];
    
    
    /**
@@ -121,13 +117,6 @@
     */
    private JSSESocketFactory sslSocketFactory = null;
    
-   private final boolean allowAdvertise;
-   
-   /**
-    * Advertise listener.
-    */
-   private AdvertiseListener listener = null;
-   
    /** Initialization completion flag */
    private boolean init;
    
@@ -135,14 +124,12 @@
    
    public DefaultMCMPHandler(MCMPHandlerConfiguration config, ResetRequestSource source)
    {
-      this(config, source, true);
-   }
-   
-   public DefaultMCMPHandler(MCMPHandlerConfiguration config, ResetRequestSource source, boolean allowAdvertise)
-   {
       this.config = config;
       this.resetRequestSource = source;
-      this.allowAdvertise = allowAdvertise;
+      
+      if (this.config.isSsl()) {
+         sslSocketFactory = new JSSESocketFactory(this.config);
+      }
    }  
    
    
@@ -160,67 +147,21 @@
       return this.config;
    }
    
-   public synchronized void init()
+   public synchronized void init(List<AddressPort> initialProxies)
    {
       if (this.init)
          return;
       
-      sslInit();
-      
-      if (this.config.getProxyList() == null) {
-         if (Boolean.FALSE.equals(this.config.getAdvertise()) == false) {
-            proxies = new Proxy[0];
-            startListener();
-         } else {
-            // Default to a httpd on localhost on the default port
-            proxies = new Proxy[1];
-            try
-            {
-               proxies[0] = new Proxy(this.sslSocketFactory, this.config.getSocketTimeout());
-            }
-            catch (UnknownHostException e)
-            {
-               proxies = new Proxy[0];
-               log.fatal(sm.getString("modcluster.error.noproxy"), e);
-            }
-         }
-      } else {
-         ArrayList<Proxy> proxyList = new ArrayList<Proxy>();
-         StringTokenizer tok = new StringTokenizer(this.config.getProxyList(), ",");
-         while (tok.hasMoreTokens()) {
-            String token = tok.nextToken().trim();
-            int pos = token.indexOf(':');
-            String address = null;
-            int port = Proxy.DEFAULT_PORT;
-            if (pos < 0) {
-               address = token;
-            } else if (pos == 0) {
-               address = null;
-               port = Integer.parseInt(token.substring(1));
-            } else {
-               address = token.substring(0, pos);
-               port = Integer.parseInt(token.substring(pos + 1));
-            }
-            InetAddress inetAddress = null;
-            try {
-               if (address != null) {
-                  inetAddress = InetAddress.getByName(address);
-               }
-            } catch (Exception e) {
-               log.error(sm.getString("modcluster.error.invalidHost", address), e);
-               continue;
-            }
-            Proxy proxy = new Proxy(inetAddress, port, this.sslSocketFactory, this.config.getSocketTimeout());
-            proxyList.add(proxy);
-         }
-         proxies = proxyList.toArray(new Proxy[proxyList.size()]);
-         
-         if (Boolean.TRUE.equals(this.config.getAdvertise()))
+      if (initialProxies != null)
+      {
+         for (AddressPort initialProxy : initialProxies)
          {
-            startListener();
+            addProxy(initialProxy.address, initialProxy.port);
          }
       }
       
+      status(false);
+      
       this.init = true;
       
    }
@@ -230,8 +171,6 @@
       if (!this.init)
          return;
       
-      stopListener();
-      
       for (int i = 0; i < proxies.length; i++) {
          synchronized (proxies[i])
          {
@@ -239,8 +178,6 @@
          }
       }
       
-      this.sslSocketFactory = null;
-      
       this.init = false;
    }
    
@@ -334,15 +271,12 @@
    {
       boolean ok = true;
       Proxy[] local = proxies;
-      if (local != null)
+      for (Proxy proxy : local)
       {
-         for (Proxy proxy : local)
+         if (proxy.getState() != MCMPServerState.State.OK)
          {
-            if (proxy.getState() != MCMPServerState.State.OK)
-            {
-               ok = false;
-               break;
-            }
+            ok = false;
+            break;
          }
       }
       return ok;
@@ -351,16 +285,13 @@
    public synchronized void markProxiesInError()
    {
       Proxy[] local = proxies;
-      if (local != null)
+      for (Proxy proxy : local)
       {
-         for (Proxy proxy : local)
+         synchronized (proxy)
          {
-            synchronized (proxy)
+            if (proxy.getState() == State.OK)
             {
-               if (proxy.getState() == State.OK)
-               {
-                  proxy.setState(Proxy.State.ERROR);
-               }
+               proxy.setState(Proxy.State.ERROR);
             }
          }
       }
@@ -441,23 +372,6 @@
           }
        }
    }
-   
-   
-   /**
-    * Refresh configuration. To be used through JMX or similar.
-    */
-   public void refresh() {
-       // Set as error, and the periodic event will refresh the configuration
-       Proxy[] local = proxies;
-       for (Proxy proxy : local) {
-          synchronized (proxy)
-          {
-           if (proxy.getState() == Proxy.State.OK) {
-              proxy.setState(Proxy.State.ERROR);
-           }
-          }
-       }
-   }   
 
 
    /**
@@ -468,32 +382,14 @@
     */
    public synchronized void status() {
        
-       // Check to add or remove proxies, and rebuild a new list if needed
-       if (!addProxies.isEmpty() || !removeProxies.isEmpty()) {
-            ArrayList<Proxy> currentProxies = new ArrayList<Proxy>();
-            for (int i = 0; i < proxies.length; i++) {
-                currentProxies.add(proxies[i]);
-            }
-            for (int i = 0; i < addProxies.size(); i++) {
-                if (!currentProxies.contains(addProxies.get(i))) {
-                    currentProxies.add(addProxies.get(i));
-                }
-            }
-            for (int i = 0; i < removeProxies.size(); i++) {
-                if (currentProxies.contains(removeProxies.get(i))) {
-                    currentProxies.remove(removeProxies.get(i));
-                }
-            }
-            addProxies.clear();
-            removeProxies.clear();
-            proxies = currentProxies.toArray(new Proxy[0]);
-            
-            // Reset all connections
-            for (Proxy proxy : proxies)
-            {                  
-               proxy.closeConnection();
-            }
-       }
+      if (!this.init)
+         return;
+      
+      status(true);
+   }
+   
+   private synchronized void status(boolean sendResetRequests) {
+       processPendingDiscoveryEvents();
        
        // Attempt to reset any proxies in error
        List<MCMPRequest> resetRequests = null;       
@@ -510,17 +406,20 @@
                  {
                     // We recovered above; if we get another IOException 
                     // we should log it                    
-                    proxy.setIoErrorLogged(false);
+                    proxy.setIoExceptionLogged(false);
                     
-                    if (resetRequests == null)
+                    if (sendResetRequests)
                     {
-                       resetRequests = this.resetRequestSource.getResetRequests();
+                       if (resetRequests == null)
+                       {
+                          resetRequests = this.resetRequestSource.getResetRequests();
+                       }
+                       
+                       for (MCMPRequest request : resetRequests)
+                       {
+                          sendRequest(request, proxy);
+                       }
                     }
-                    
-                    for (MCMPRequest request : resetRequests)
-                    {
-                       sendRequest(request, proxy);
-                    }
                  }
               }
            }
@@ -560,8 +459,46 @@
       }      
    }
 
+   // ----------------------------------------------------------------  Private
+   
+   private synchronized void processPendingDiscoveryEvents()
+   {
+      // Check to add or remove proxies, and rebuild a new list if needed
+       if (!addProxies.isEmpty() || !removeProxies.isEmpty()) {
+            ArrayList<Proxy> currentProxies = new ArrayList<Proxy>();
+            for (int i = 0; i < proxies.length; i++) {
+                currentProxies.add(proxies[i]);
+            }
+            for (int i = 0; i < addProxies.size(); i++) {
+                if (!currentProxies.contains(addProxies.get(i))) {
+                    currentProxies.add(addProxies.get(i));
+                }
+            }
+            for (int i = 0; i < removeProxies.size(); i++) {
+                if (currentProxies.contains(removeProxies.get(i))) {
+                    currentProxies.remove(removeProxies.get(i));
+                }
+            }
+            addProxies.clear();
+            removeProxies.clear();
+            proxies = currentProxies.toArray(new Proxy[0]);
+            
+            // Reset all connections
+            for (Proxy proxy : proxies)
+            {                  
+               proxy.closeConnection();
+            }
+       }
+   }
+
    private synchronized String sendRequest(MCMPRequest request, Proxy proxy) {
 
+      // If there was an error, do nothing until the next periodic event, where the whole configuration
+      // will be refreshed
+      if (proxy.getState() != Proxy.State.OK) {
+          return null;
+      }
+
        BufferedReader reader = null;
        BufferedWriter writer = null;
        CharChunk body = null;
@@ -595,15 +532,9 @@
            // Error encoding URL, should not happen
            throw new IllegalArgumentException(e);
        }
-
-        // If there was an error, do nothing until the next periodic event, where the whole configuration
-        // will be refreshed
-        if (proxy.getState() != Proxy.State.OK) {
-            return null;
-        }
         
-        if (log.isDebugEnabled()) {
-            log.debug(sm.getString("modcluster.request", command, wildcard, proxy));
+        if (log.isTraceEnabled()) {
+            log.trace(sm.getString("modcluster.request", command, wildcard, proxy));
         }
         
         synchronized (proxy)
@@ -729,9 +660,9 @@
                proxy.setState(Proxy.State.ERROR);
                
                // Log it only if we haven't done so already. Don't spam the log
-               if (proxy.isIoErrorLogged() == false) {                  
+               if (proxy.isIoExceptionLogged() == false) {                  
                   log.info(sm.getString("modcluster.error.io", command, proxy), e);
-                  proxy.setIoErrorLogged(true);
+                  proxy.setIoExceptionLogged(true);
                }
            } finally {
                // If there's an error of any sort, or if the proxy did not return 200, it is an error
@@ -744,61 +675,8 @@
        return null;
        
    }
-
    
    /**
-    * SSL init.
-    */
-   protected void sslInit() {
-       if (this.config.isSsl()) {
-           sslSocketFactory = new JSSESocketFactory(this.config);
-       }
-   }    
-   
-   /**
-    * Start the advertise listener.
-    */
-   protected void startListener() 
-   {
-      if (this.allowAdvertise)
-      {
-          listener = new AdvertiseListener(this);
-          if (this.config.getAdvertiseGroupAddress() != null) {
-              listener.setGroupAddress(this.config.getAdvertiseGroupAddress());
-          }
-          if (this.config.getAdvertisePort() > 0) {
-              listener.setAdvertisePort(this.config.getAdvertisePort());
-          }
-          try {
-              if (this.config.getAdvertiseSecurityKey() != null) {
-                  listener.setSecurityKey(this.config.getAdvertiseSecurityKey());
-              }
-              listener.start();
-          } catch (IOException e) {
-              log.error(sm.getString("modcluster.error.startListener"), e);
-          } catch (NoSuchAlgorithmException e) {
-              // Should never happen
-              log.error(sm.getString("modcluster.error.startListener"), e);
-          }
-      }
-   }
-   
-
-   /**
-    * Stop the advertise listener.
-    */
-   protected void stopListener() {
-       if (listener != null) {
-           try {
-               listener.destroy();
-           } catch (IOException e) {
-               log.error(sm.getString("modcluster.error.stopListener"), e);
-           }
-           listener = null;
-       }
-   }
-   
-   /**
     * This class represents a front-end httpd server.
     */
    private static class Proxy implements MCMPServerState
@@ -814,7 +692,7 @@
       private Socket connection;
       private BufferedReader connectionReader;
       private BufferedWriter connectionWriter;
-      private boolean ioErrorLogged;
+      private boolean ioExceptionLogged;
 
       /**
        * The string manager for this package.
@@ -822,31 +700,6 @@
       private final StringManager sm =
           StringManager.getManager(Constants.Package);
       
-      private Proxy(int socketTimeout) throws UnknownHostException
-      {
-         this(InetAddress.getLocalHost(), DEFAULT_PORT, null, socketTimeout);
-      }
-      
-      private Proxy(JSSESocketFactory sslSocketFactory, int socketTimeout) throws UnknownHostException
-      {
-         this(InetAddress.getLocalHost(), DEFAULT_PORT, sslSocketFactory, socketTimeout);
-      }
-      
-      private Proxy(InetAddress address, int socketTimeout)
-      {
-         this(address, DEFAULT_PORT, null, socketTimeout);
-      }
-      
-      private Proxy(InetAddress address, JSSESocketFactory sslSocketFactory, int socketTimeout)
-      {
-         this(address, DEFAULT_PORT, sslSocketFactory, socketTimeout);
-      }
-      
-      private Proxy(InetAddress address, int port, int socketTimeout)
-      {
-         this(address, port, null, socketTimeout);
-      }
-      
       private Proxy(InetAddress address, int port, JSSESocketFactory sslSocketFactory, int socketTimeout)
       {
          if (address == null)
@@ -1012,14 +865,14 @@
           connection = null;
       }
 
-      private boolean isIoErrorLogged()
+      private boolean isIoExceptionLogged()
       {
-         return this.ioErrorLogged;
+         return this.ioExceptionLogged;
       }
 
-      private void setIoErrorLogged(boolean ioErrorLogged)
+      private void setIoExceptionLogged(boolean ioErrorLogged)
       {
-         this.ioErrorLogged = ioErrorLogged;
+         this.ioExceptionLogged = ioErrorLogged;
       }
       
       




More information about the jboss-cvs-commits mailing list