tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1366726 - /tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java
Date Sat, 28 Jul 2012 18:29:04 GMT
Author: markt
Date: Sat Jul 28 18:29:04 2012
New Revision: 1366726

URL: http://svn.apache.org/viewvc?rev=1366726&view=rev
Log:
Clean-up. Refactor to avoid unnecessary object creation when not using default constructor

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java?rev=1366726&r1=1366725&r2=1366726&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/group/ChannelCoordinator.java Sat Jul 28
18:29:04 2012
@@ -41,23 +41,25 @@ import org.apache.catalina.tribes.util.L
  * @version $Id$
  */
 public class ChannelCoordinator extends ChannelInterceptorBase implements MessageListener
{
-    private ChannelReceiver clusterReceiver = new NioReceiver();
-    private ChannelSender clusterSender = new ReplicationTransmitter();
-    private MembershipService membershipService = new McastService();
+    private ChannelReceiver clusterReceiver;
+    private ChannelSender clusterSender;
+    private MembershipService membershipService;
 
     private int startLevel = 0;
 
     public ChannelCoordinator() {
-        // Override default
-        this.optionFlag = Channel.SEND_OPTIONS_BYTE_MESSAGE |
-                Channel.SEND_OPTIONS_USE_ACK |
-                Channel.SEND_OPTIONS_SYNCHRONIZED_ACK;
+        this(new NioReceiver(), new ReplicationTransmitter(),
+                new McastService());
     }
 
     public ChannelCoordinator(ChannelReceiver receiver,
                               ChannelSender sender,
                               MembershipService service) {
-        this();
+
+        this.optionFlag = Channel.SEND_OPTIONS_BYTE_MESSAGE |
+                Channel.SEND_OPTIONS_USE_ACK |
+                Channel.SEND_OPTIONS_SYNCHRONIZED_ACK;
+
         this.setClusterReceiver(receiver);
         this.setClusterSender(sender);
         this.setMembershipService(service);



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


Mime
View raw message