activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r702358 - in /activemq/sandbox/groupmq/src/main/java/org/apache/groupmq: ./ command/
Date Tue, 07 Oct 2008 06:14:15 GMT
Author: rajdavies
Date: Mon Oct  6 23:14:14 2008
New Revision: 702358

URL: http://svn.apache.org/viewvc?rev=702358&view=rev
Log:
moved commands to a separate package

Added:
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/AsyncMapRequest.java
      - copied, changed from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/AsyncMapRequest.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/ElectionMessage.java
      - copied, changed from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/ElectionMessage.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryKey.java
      - copied, changed from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryKey.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryMessage.java
      - copied, changed from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryMessage.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryValue.java
      - copied, changed from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryValue.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/MapRequest.java
      - copied, changed from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/MapRequest.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/RequestCallback.java
      - copied, changed from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/RequestCallback.java
Removed:
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/AsyncMapRequest.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/ElectionMessage.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryKey.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryMessage.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryValue.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/MapRequest.java
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/RequestCallback.java
Modified:
    activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/Group.java

Modified: activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/Group.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/Group.java?rev=702358&r1=702357&r2=702358&view=diff
==============================================================================
--- activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/Group.java (original)
+++ activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/Group.java Mon Oct  6 23:14:14
2008
@@ -57,6 +57,12 @@
 import org.apache.activemq.util.IdGenerator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.groupmq.command.AsyncMapRequest;
+import org.apache.groupmq.command.ElectionMessage;
+import org.apache.groupmq.command.EntryKey;
+import org.apache.groupmq.command.EntryMessage;
+import org.apache.groupmq.command.EntryValue;
+import org.apache.groupmq.command.MapRequest;
 
 /**
  * <P>
@@ -328,7 +334,7 @@
                     EXPIRATION_SWEEP_INTERVAL, EXPIRATION_SWEEP_INTERVAL);
             // await for members to join
             long timeout = (long) (this.heartBeatInterval
-                    * this.minimumGroupSize );
+                    * this.minimumGroupSize *1.5);
             long deadline = System.currentTimeMillis() + timeout;
             while ((this.members.size() < this.minimumGroupSize || !this.electionFinished
                     .get())
@@ -1760,8 +1766,8 @@
                 try {
                     this.electionFinished.wait(200);
                 } catch (InterruptedException e) {
+                    LOG.warn("Interrupted in waitForElection");
                     stop();
-                    Thread.currentThread().interrupt();
                 }
             }
         }

Copied: activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/AsyncMapRequest.java
(from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/AsyncMapRequest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/AsyncMapRequest.java?p2=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/AsyncMapRequest.java&p1=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/AsyncMapRequest.java&r1=685613&r2=702358&rev=702358&view=diff
==============================================================================
--- activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/AsyncMapRequest.java (original)
+++ activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/AsyncMapRequest.java
Mon Oct  6 23:14:14 2008
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.groupmq;
+package org.apache.groupmq.command;
 
 import java.util.HashSet;
 import java.util.Set;

Copied: activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/ElectionMessage.java
(from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/ElectionMessage.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/ElectionMessage.java?p2=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/ElectionMessage.java&p1=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/ElectionMessage.java&r1=685613&r2=702358&rev=702358&view=diff
==============================================================================
--- activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/ElectionMessage.java (original)
+++ activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/ElectionMessage.java
Mon Oct  6 23:14:14 2008
@@ -14,19 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.groupmq;
+package org.apache.groupmq.command;
 
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
+import org.apache.groupmq.Member;
 
 /**
  * Used to pass information around
  *
  */
 public class ElectionMessage implements Externalizable{
-    static enum MessageType{ELECTION,ANSWER,COORDINATOR};
+    public static enum MessageType{ELECTION,ANSWER,COORDINATOR};
     private Member member;
     private MessageType type;
     

Copied: activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryKey.java (from
r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryKey.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryKey.java?p2=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryKey.java&p1=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryKey.java&r1=685613&r2=702358&rev=702358&view=diff
==============================================================================
--- activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryKey.java (original)
+++ activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryKey.java Mon Oct
 6 23:14:14 2008
@@ -14,18 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.groupmq;
+package org.apache.groupmq.command;
 
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
+import org.apache.groupmq.Member;
 
 /**
  * Holds information about an EntryKey
  * 
  */
-class EntryKey<K> implements Externalizable {
+public class EntryKey<K> implements Externalizable {
     private Member owner;
     private K key;
     private boolean locked;
@@ -40,7 +41,7 @@
     public EntryKey() {
     }
 
-    EntryKey(Member owner, K key) {
+    public EntryKey(Member owner, K key) {
         this.owner = owner;
         this.key = key;
     }
@@ -138,7 +139,7 @@
         this.releaseLockOnExit = releaseLockOnExit;
     }
     
-    void setTimeToLive(long ttl) {
+    public void setTimeToLive(long ttl) {
         if (ttl > 0 ) {
             this.expiration=ttl+System.currentTimeMillis();
         }else {
@@ -146,7 +147,7 @@
         }
     }
     
-    void setLockLeaseTime(long ttl) {
+    public void setLockLeaseTime(long ttl) {
         if(ttl > 0) {
             this.lockExpiration=ttl+System.currentTimeMillis();
         }else {
@@ -154,19 +155,19 @@
         }
     }
     
-    boolean isExpired() {
+    public boolean isExpired() {
         return isExpired(System.currentTimeMillis());
     }
     
-    boolean isExpired(long currentTime) {
+    public boolean isExpired(long currentTime) {
         return this.expiration > 0 && this.expiration < currentTime;
     }
     
-    boolean isLockExpired() {
+    public boolean isLockExpired() {
         return isLockExpired(System.currentTimeMillis());
     }
     
-    boolean isLockExpired(long currentTime) {
+    public boolean isLockExpired(long currentTime) {
         return this.lockExpiration > 0 && this.lockExpiration < currentTime;
     }
     

Copied: activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryMessage.java
(from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryMessage.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryMessage.java?p2=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryMessage.java&p1=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryMessage.java&r1=685613&r2=702358&rev=702358&view=diff
==============================================================================
--- activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryMessage.java (original)
+++ activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryMessage.java Mon
Oct  6 23:14:14 2008
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.groupmq;
+package org.apache.groupmq.command;
 
 import java.io.Externalizable;
 import java.io.IOException;
@@ -26,7 +26,7 @@
  *
  */
 public class EntryMessage implements Externalizable{
-    static enum MessageType{INSERT,DELETE,SYNC};
+    public static enum MessageType{INSERT,DELETE,SYNC};
     private EntryKey key;
     private Object value;
     private Object oldValue;

Copied: activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryValue.java
(from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryValue.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryValue.java?p2=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryValue.java&p1=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryValue.java&r1=685613&r2=702358&rev=702358&view=diff
==============================================================================
--- activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/EntryValue.java (original)
+++ activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/EntryValue.java Mon
Oct  6 23:14:14 2008
@@ -14,19 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.groupmq;
+package org.apache.groupmq.command;
+
 
 
 /**
  * Holds information about the Value in the Map
  *
  */
-class EntryValue<V> {
+public class EntryValue<V> {
     private EntryKey key;
     private V value;
     
     
-    EntryValue(EntryKey key, V value){
+    public EntryValue(EntryKey key, V value){
         this.key=key;
         this.value=value;
     }

Copied: activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/MapRequest.java
(from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/MapRequest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/MapRequest.java?p2=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/MapRequest.java&p1=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/MapRequest.java&r1=685613&r2=702358&rev=702358&view=diff
==============================================================================
--- activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/MapRequest.java (original)
+++ activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/MapRequest.java Mon
Oct  6 23:14:14 2008
@@ -14,33 +14,36 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.groupmq;
+package org.apache.groupmq.command;
 
 import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * Return information about map update
  * 
  */
 public class MapRequest {
+    private static final Log LOG = LogFactory.getLog(MapRequest.class);
     private final AtomicBoolean done = new AtomicBoolean();
     private Object response;
     private RequestCallback callback;
 
-    Object get(long timeout) {
+    public Object get(long timeout) {
         synchronized (this.done) {
             if (this.done.get() == false && this.response == null) {
                 try {
                     this.done.wait(timeout);
                 } catch (InterruptedException e) {
-                    Thread.currentThread().interrupt();
+                    LOG.warn("Interrupted in  get("+timeout+")",e);
                 }
             }
         }
         return this.response;
     }
 
-    void put(String id,Object response) {
+    public void put(String id,Object response) {
         this.response = response;
         cancel();
         RequestCallback callback = this.callback;
@@ -49,14 +52,14 @@
         }
     }
 
-    void cancel() {
+    public void cancel() {
         this.done.set(true);
         synchronized (this.done) {
             this.done.notifyAll();
         }
     }
     
-    void setCallback(RequestCallback callback) {
+    public void setCallback(RequestCallback callback) {
         this.callback=callback;
     }
 }

Copied: activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/RequestCallback.java
(from r685613, activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/RequestCallback.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/RequestCallback.java?p2=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/RequestCallback.java&p1=activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/RequestCallback.java&r1=685613&r2=702358&rev=702358&view=diff
==============================================================================
--- activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/RequestCallback.java (original)
+++ activemq/sandbox/groupmq/src/main/java/org/apache/groupmq/command/RequestCallback.java
Mon Oct  6 23:14:14 2008
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.groupmq;
+package org.apache.groupmq.command;
 
 
 /**



Mime
View raw message