tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r777247 - /tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/SimpleCoordinator.java
Date Thu, 21 May 2009 20:35:36 GMT
Author: rjung
Date: Thu May 21 20:35:36 2009
New Revision: 777247

URL: http://svn.apache.org/viewvc?rev=777247&view=rev
Log:
Missing svn properties keywords and eol-style.
Found while checking the 6.0.20 release candidate.
Guys fix your svn configuration. ;)

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/SimpleCoordinator.java
  (contents, props changed)

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/SimpleCoordinator.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/SimpleCoordinator.java?rev=777247&r1=777246&r2=777247&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/SimpleCoordinator.java
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/SimpleCoordinator.java
Thu May 21 20:35:36 2009
@@ -1,118 +1,118 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- */
-package org.apache.catalina.tribes.group.interceptors;
-
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-
-import java.util.Arrays;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.catalina.tribes.ChannelException;
-import org.apache.catalina.tribes.Member;
-import org.apache.catalina.tribes.group.AbsoluteOrder;
-import org.apache.catalina.tribes.group.ChannelInterceptorBase;
-
-/**
- * A dinky coordinator, just uses a sorted version of the member array.
- * 
- * @author rnewson
- * 
- */
-public class SimpleCoordinator extends ChannelInterceptorBase {
-
-    private Member[] view;
-
-    private AtomicBoolean membershipChanged = new AtomicBoolean();
-
-    private void membershipChanged() {
-        membershipChanged.set(true);
-    }
-
-    @Override
-    public void memberAdded(final Member member) {
-        super.memberAdded(member);
-        membershipChanged();
-        installViewWhenStable();
-    }
-
-    @Override
-    public void memberDisappeared(final Member member) {
-        super.memberDisappeared(member);
-        membershipChanged();
-        installViewWhenStable();
-    }
-
-    /**
-     * Override to receive view changes.
-     * 
-     * @param view
-     */
-    protected void viewChange(final Member[] view) {
-    }
-
-    @Override
-    public void start(int svc) throws ChannelException {
-        super.start(svc);
-        installViewWhenStable();
-    }
-
-    private void installViewWhenStable() {
-        int stableCount = 0;
-
-        while (stableCount < 10) {
-            if (membershipChanged.compareAndSet(true, false)) {
-                stableCount = 0;
-            } else {
-                stableCount++;
-            }
-            try {
-                MILLISECONDS.sleep(250);
-            } catch (final InterruptedException e) {
-                Thread.currentThread().interrupt();
-            }
-        }
-
-        final Member[] members = getMembers();
-        final Member[] view = new Member[members.length+1];
-        System.arraycopy(members, 0, view, 0, members.length);
-        view[members.length] = getLocalMember(false);
-        Arrays.sort(view, AbsoluteOrder.comp);
-        if (Arrays.equals(view, this.view)) {
-            return;
-        }
-        this.view = view;
-        viewChange(view);
-    }
-
-    @Override
-    public void stop(int svc) throws ChannelException {
-        super.stop(svc);
-    }
-
-    public Member[] getView() {
-        return view;
-    }
-
-    public Member getCoordinator() {
-        return view == null ? null : view[0];
-    }
-
-    public boolean isCoordinator() {
-        return view == null ? false : getLocalMember(false).equals(
-                getCoordinator());
-    }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ */
+package org.apache.catalina.tribes.group.interceptors;
+
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+
+import java.util.Arrays;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.catalina.tribes.ChannelException;
+import org.apache.catalina.tribes.Member;
+import org.apache.catalina.tribes.group.AbsoluteOrder;
+import org.apache.catalina.tribes.group.ChannelInterceptorBase;
+
+/**
+ * A dinky coordinator, just uses a sorted version of the member array.
+ * 
+ * @author rnewson
+ * 
+ */
+public class SimpleCoordinator extends ChannelInterceptorBase {
+
+    private Member[] view;
+
+    private AtomicBoolean membershipChanged = new AtomicBoolean();
+
+    private void membershipChanged() {
+        membershipChanged.set(true);
+    }
+
+    @Override
+    public void memberAdded(final Member member) {
+        super.memberAdded(member);
+        membershipChanged();
+        installViewWhenStable();
+    }
+
+    @Override
+    public void memberDisappeared(final Member member) {
+        super.memberDisappeared(member);
+        membershipChanged();
+        installViewWhenStable();
+    }
+
+    /**
+     * Override to receive view changes.
+     * 
+     * @param view
+     */
+    protected void viewChange(final Member[] view) {
+    }
+
+    @Override
+    public void start(int svc) throws ChannelException {
+        super.start(svc);
+        installViewWhenStable();
+    }
+
+    private void installViewWhenStable() {
+        int stableCount = 0;
+
+        while (stableCount < 10) {
+            if (membershipChanged.compareAndSet(true, false)) {
+                stableCount = 0;
+            } else {
+                stableCount++;
+            }
+            try {
+                MILLISECONDS.sleep(250);
+            } catch (final InterruptedException e) {
+                Thread.currentThread().interrupt();
+            }
+        }
+
+        final Member[] members = getMembers();
+        final Member[] view = new Member[members.length+1];
+        System.arraycopy(members, 0, view, 0, members.length);
+        view[members.length] = getLocalMember(false);
+        Arrays.sort(view, AbsoluteOrder.comp);
+        if (Arrays.equals(view, this.view)) {
+            return;
+        }
+        this.view = view;
+        viewChange(view);
+    }
+
+    @Override
+    public void stop(int svc) throws ChannelException {
+        super.stop(svc);
+    }
+
+    public Member[] getView() {
+        return view;
+    }
+
+    public Member getCoordinator() {
+        return view == null ? null : view[0];
+    }
+
+    public boolean isCoordinator() {
+        return view == null ? false : getLocalMember(false).equals(
+                getCoordinator());
+    }
+
+}

Propchange: tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/SimpleCoordinator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/SimpleCoordinator.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



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


Mime
View raw message