axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From az...@apache.org
Subject svn commit: r803378 - in /webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering: management/ state/ state/commands/ tribes/
Date Wed, 12 Aug 2009 06:50:36 GMT
Author: azeez
Date: Wed Aug 12 06:50:30 2009
New Revision: 803378

URL: http://svn.apache.org/viewvc?rev=803378&view=rev
Log:
Improving code based on feedback from http://nemo.sonarsource.org/drilldown/violations/org.apache.axis2:axis2-clustering?rids[]=82698&rule=pmd%3AImmutableField#

Modified:
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/management/DefaultGroupManagementAgent.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/management/DefaultNodeManager.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/ClusteringContextListener.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/DefaultStateManager.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/commands/StateClusteringCommandCollection.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ApplicationMode.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/Axis2Coordinator.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ClusterManagementMode.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/MembershipManager.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/MulticastBasedMembershipScheme.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusteringAgent.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesMembershipListener.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/WkaBasedMembershipScheme.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/WkaMembershipService.java

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/management/DefaultGroupManagementAgent.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/management/DefaultGroupManagementAgent.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/management/DefaultGroupManagementAgent.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/management/DefaultGroupManagementAgent.java
Wed Aug 12 06:50:30 2009
@@ -39,7 +39,7 @@
 public class DefaultGroupManagementAgent implements GroupManagementAgent {
 
     private static final Log log = LogFactory.getLog(DefaultGroupManagementAgent.class);
-    private List<Member> members = new ArrayList<Member>();
+    private final List<Member> members = new ArrayList<Member>();
     private ChannelSender sender;
     private MembershipManager membershipManager;
     private RpcChannel rpcChannel; //TODO

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/management/DefaultNodeManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/management/DefaultNodeManager.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/management/DefaultNodeManager.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/management/DefaultNodeManager.java
Wed Aug 12 06:50:30 2009
@@ -38,7 +38,7 @@
 
     private MessageSender sender;
     private ConfigurationContext configurationContext;
-    private Map<String, Parameter> parameters = new HashMap<String, Parameter>();
+    private final Map<String, Parameter> parameters = new HashMap<String, Parameter>();
 
     public DefaultNodeManager() {
     }

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/ClusteringContextListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/ClusteringContextListener.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/ClusteringContextListener.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/ClusteringContextListener.java
Wed Aug 12 06:50:30 2009
@@ -32,7 +32,7 @@
 public class ClusteringContextListener implements ContextListener {
     private static final Log log = LogFactory.getLog(ClusteringContextListener.class);
 
-    private MessageSender sender;
+    private final MessageSender sender;
 
     public ClusteringContextListener(MessageSender sender) {
         this.sender = sender;

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/DefaultStateManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/DefaultStateManager.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/DefaultStateManager.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/DefaultStateManager.java
Wed Aug 12 06:50:30 2009
@@ -39,11 +39,11 @@
 
     private ConfigurationContext configContext;
 
-    private Map<String, Parameter> parameters = new HashMap<String, Parameter>();
+    private final Map<String, Parameter> parameters = new HashMap<String, Parameter>();
 
     private ChannelSender sender;
 
-    private Map<String, List> excludedReplicationPatterns = new HashMap<String,
List>();
+    private final Map<String, List> excludedReplicationPatterns = new HashMap<String,
List>();
 
     //TODO: Try to use an interface
     public void setSender(ChannelSender sender) {

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/commands/StateClusteringCommandCollection.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/commands/StateClusteringCommandCollection.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/commands/StateClusteringCommandCollection.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/state/commands/StateClusteringCommandCollection.java
Wed Aug 12 06:50:30 2009
@@ -30,7 +30,7 @@
  */
 public class StateClusteringCommandCollection extends StateClusteringCommand {
 
-    private ArrayList commands;
+    private final ArrayList commands;
 
     public StateClusteringCommandCollection(ArrayList commands) {
         this.commands = commands;

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ApplicationMode.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ApplicationMode.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ApplicationMode.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ApplicationMode.java
Wed Aug 12 06:50:30 2009
@@ -29,10 +29,10 @@
  */
 public class ApplicationMode implements OperationMode {
 
-     private static final Log log = LogFactory.getLog(ClusterManagementMode.class);
+    private static final Log log = LogFactory.getLog(ClusterManagementMode.class);
 
-    private byte[] domain;
-    private MembershipManager membershipManager;
+    private final byte[] domain;
+    private final MembershipManager membershipManager;
 
     public ApplicationMode(byte[] domain, MembershipManager membershipManager) {
         this.domain = domain;

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/Axis2Coordinator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/Axis2Coordinator.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/Axis2Coordinator.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/Axis2Coordinator.java
Wed Aug 12 06:50:30 2009
@@ -24,7 +24,7 @@
  */
 public class Axis2Coordinator extends NonBlockingCoordinator {
 
-    private MembershipListener membershipListener;
+    private final MembershipListener membershipListener;
 
     public Axis2Coordinator(MembershipListener membershipListener) {
         this.membershipListener = membershipListener;

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ClusterManagementMode.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ClusterManagementMode.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ClusterManagementMode.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ClusterManagementMode.java
Wed Aug 12 06:50:30 2009
@@ -38,10 +38,10 @@
 
     private static final Log log = LogFactory.getLog(ClusterManagementMode.class);
 
-    private byte[] clusterManagerDomain;
-    private Map<String, GroupManagementAgent> groupManagementAgents;
-    private List<MembershipManager> membershipManagers = new ArrayList<MembershipManager>();
-    private MembershipManager primaryMembershipManager;
+    private final byte[] clusterManagerDomain;
+    private final Map<String, GroupManagementAgent> groupManagementAgents;
+    private final List<MembershipManager> membershipManagers = new ArrayList<MembershipManager>();
+    private final MembershipManager primaryMembershipManager;
 
     public ClusterManagementMode(byte[] clusterManagerDomain,
                             Map<String, GroupManagementAgent> groupManagementAgents,

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/MembershipManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/MembershipManager.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/MembershipManager.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/MembershipManager.java
Wed Aug 12 06:50:30 2009
@@ -55,6 +55,23 @@
     private GroupManagementAgent groupManagementAgent;
     private ConfigurationContext configContext;
 
+
+    /**
+     * List of current members in the cluster. Only the members who are alive will be in
this
+     * list
+     */
+    private final List<Member> members = new ArrayList<Member>();
+
+    /**
+     * List of Well-Known members. These members may or may not be alive at a given moment.
+     */
+    private final List<Member> wkaMembers = new ArrayList<Member>();
+
+    /**
+     * The member representing this node
+     */
+    private Member localMember;
+
     public MembershipManager(ConfigurationContext configContext) {
         this.configContext = configContext;
     }
@@ -87,22 +104,6 @@
         return domain;
     }
 
-    /**
-     * List of current members in the cluster. Only the members who are alive will be in
this
-     * list
-     */
-    private final List<Member> members = new ArrayList<Member>();
-
-    /**
-     * List of Well-Known members. These members may or may not be alive at a given moment.
-     */
-    private List<Member> wkaMembers = new ArrayList<Member>();
-
-    /**
-     * The member representing this node
-     */
-    private Member localMember;
-
     public Member getLocalMember() {
         return localMember;
     }

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/MulticastBasedMembershipScheme.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/MulticastBasedMembershipScheme.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/MulticastBasedMembershipScheme.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/MulticastBasedMembershipScheme.java
Wed Aug 12 06:50:30 2009
@@ -42,22 +42,22 @@
     /**
      * The Tribes channel
      */
-    private ManagedChannel channel;
-    private Map<String, Parameter> parameters;
+    private final ManagedChannel channel;
+    private final Map<String, Parameter> parameters;
 
     /**
      * The domain to which this node belongs to
      */
-    private byte[] domain;
+    private final byte[] domain;
 
     /**
      * The mode in which this member operates such as "loadBalance" or "application"
      */
-    private OperationMode mode;
+    private final OperationMode mode;
 
     //    private MembershipListener membershipListener;
-    private boolean atmostOnceMessageSemantics;
-    private boolean preserverMsgOrder;
+    private final boolean atmostOnceMessageSemantics;
+    private final boolean preserverMsgOrder;
 
     public MulticastBasedMembershipScheme(ManagedChannel channel,
                                           OperationMode mode,

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusteringAgent.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusteringAgent.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusteringAgent.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusteringAgent.java
Wed Aug 12 06:50:30 2009
@@ -80,7 +80,7 @@
     private DefaultNodeManager configurationManager;
     private DefaultStateManager contextManager;
 
-    private HashMap<String, Parameter> parameters;
+    private final HashMap<String, Parameter> parameters;
     private ManagedChannel channel;
     private RpcChannel rpcInitChannel;
     private ConfigurationContext configurationContext;

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesMembershipListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesMembershipListener.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesMembershipListener.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesMembershipListener.java
Wed Aug 12 06:50:30 2009
@@ -30,7 +30,7 @@
 public class TribesMembershipListener implements MembershipListener {
 
     private static Log log = LogFactory.getLog(TribesMembershipListener.class);
-    private MembershipManager membershipManager;
+    private final MembershipManager membershipManager;
 
     public TribesMembershipListener(MembershipManager membershipManager) {
         this.membershipManager = membershipManager;

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/WkaBasedMembershipScheme.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/WkaBasedMembershipScheme.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/WkaBasedMembershipScheme.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/WkaBasedMembershipScheme.java
Wed Aug 12 06:50:30 2009
@@ -58,29 +58,29 @@
     /**
      * The Tribes channel
      */
-    private ManagedChannel channel;
-    private MembershipManager primaryMembershipManager;
-    private List<MembershipManager> applicationDomainMembershipManagers;
+    private final ManagedChannel channel;
+    private final MembershipManager primaryMembershipManager;
+    private final List<MembershipManager> applicationDomainMembershipManagers;
     private StaticMembershipInterceptor staticMembershipInterceptor;
-    private Map<String, Parameter> parameters;
+    private final Map<String, Parameter> parameters;
 
     /**
      * The loadBalancerDomain to which the members belong to
      */
-    private byte[] localDomain;
+    private final byte[] localDomain;
 
     /**
      * The static(well-known) members
      */
-    private List<Member> members;
+    private final List<Member> members;
 
     /**
      * The mode in which this member operates such as "loadBalance" or "application"
      */
-    private OperationMode mode;
+    private final OperationMode mode;
 
-    private boolean atmostOnceMessageSemantics;
-    private boolean preserverMsgOrder;
+    private final boolean atmostOnceMessageSemantics;
+    private final boolean preserverMsgOrder;
 
     public WkaBasedMembershipScheme(ManagedChannel channel,
                                     OperationMode mode,

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/WkaMembershipService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/WkaMembershipService.java?rev=803378&r1=803377&r2=803378&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/WkaMembershipService.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/WkaMembershipService.java
Wed Aug 12 06:50:30 2009
@@ -30,7 +30,7 @@
  */
 public class WkaMembershipService implements MembershipService {
 
-    private MembershipManager membershipManager;
+    private final MembershipManager membershipManager;
 
 
     /**



Mime
View raw message