You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bs...@apache.org on 2015/08/21 23:22:59 UTC
[35/51] [partial] incubator-geode git commit: GEODE-77 removing the
old jgroups subproject
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SyncSortedSet.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SyncSortedSet.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SyncSortedSet.java
deleted file mode 100644
index 57ab3fc..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SyncSortedSet.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SyncSortedSet.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 1Aug1998 dl Create public version
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-import java.util.*;
-
-/**
- * SyncSortedSets wrap Sync-based control around java.util.SortedSets.
- * They support the following additional reader operations over
- * SyncCollection: comparator, subSet, headSet, tailSet, first, last.
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- * @see SyncCollection
-**/
-
-
-public class SyncSortedSet extends SyncSet implements SortedSet {
-
- /**
- * Create a new SyncSortedSet protecting the given collection,
- * and using the given sync to control both reader and writer methods.
- * Common, reasonable choices for the sync argument include
- * Mutex, ReentrantLock, and Semaphores initialized to 1.
- **/
- public SyncSortedSet(SortedSet set, Sync sync) {
- super (set, sync);
- }
-
- /**
- * Create a new SyncSortedSet protecting the given set,
- * and using the given ReadWriteLock to control reader and writer methods.
- **/
- public SyncSortedSet(SortedSet set, ReadWriteLock rwl) {
- super (set, rwl.readLock(), rwl.writeLock());
- }
-
- /**
- * Create a new SyncSortedSet protecting the given set,
- * and using the given pair of locks to control reader and writer methods.
- **/
- public SyncSortedSet(SortedSet set, Sync readLock, Sync writeLock) {
- super(set, readLock, writeLock);
- }
-
-
- protected SortedSet baseSortedSet() {
- return (SortedSet)c_;
- }
-
- public Comparator comparator() {
- boolean wasInterrupted = beforeRead();
- try {
- return baseSortedSet().comparator();
- }
- finally {
- afterRead(wasInterrupted);
- }
- }
-
- public Object first() {
- boolean wasInterrupted = beforeRead();
- try {
- return baseSortedSet().first();
- }
- finally {
- afterRead(wasInterrupted);
- }
- }
-
- public Object last() {
- boolean wasInterrupted = beforeRead();
- try {
- return baseSortedSet().last();
- }
- finally {
- afterRead(wasInterrupted);
- }
- }
-
-
- public SortedSet subSet(Object fromElement, Object toElement) {
- boolean wasInterrupted = beforeRead();
- try {
- return new SyncSortedSet(baseSortedSet().subSet(fromElement, toElement),
- rd_, wr_);
- }
- finally {
- afterRead(wasInterrupted);
- }
- }
-
- public SortedSet headSet(Object toElement) {
- boolean wasInterrupted = beforeRead();
- try {
- return new SyncSortedSet(baseSortedSet().headSet(toElement),
- rd_, wr_);
- }
- finally {
- afterRead(wasInterrupted);
- }
- }
-
- public SortedSet tailSet(Object fromElement) {
- boolean wasInterrupted = beforeRead();
- try {
- return new SyncSortedSet(baseSortedSet().tailSet(fromElement),
- rd_, wr_);
- }
- finally {
- afterRead(wasInterrupted);
- }
- }
-
-}
-
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedBoolean.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedBoolean.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedBoolean.java
deleted file mode 100644
index f9c3143..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedBoolean.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SynchronizedBoolean.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 19Jun1998 dl Create public version
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * A class useful for offloading synch for boolean instance variables.
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-
-public class SynchronizedBoolean extends SynchronizedVariable implements Comparable, Cloneable {
- protected boolean value_;
-
- /**
- * Make a new SynchronizedBoolean with the given initial value,
- * and using its own internal lock.
- **/
- public SynchronizedBoolean(boolean initialValue) {
- super();
- value_ = initialValue;
- }
-
- /**
- * Make a new SynchronizedBoolean with the given initial value,
- * and using the supplied lock.
- **/
- public SynchronizedBoolean(boolean initialValue, Object lock) {
- super(lock);
- value_ = initialValue;
- }
-
- /**
- * Return the current value
- **/
- public final boolean get() { synchronized(lock_) { return value_; } }
-
- /**
- * Set to newValue.
- * @return the old value
- **/
-
- public boolean set(boolean newValue) {
- synchronized (lock_) {
- boolean old = value_;
- value_ = newValue;
- return old;
- }
- }
-
- /**
- * Set value to newValue only if it is currently assumedValue.
- * @return true if successful
- **/
- public boolean commit(boolean assumedValue, boolean newValue) {
- synchronized(lock_) {
- boolean success = (assumedValue == value_);
- if (success) value_ = newValue;
- return success;
- }
- }
-
- /**
- * Atomically swap values with another SynchronizedBoolean.
- * Uses identityHashCode to avoid deadlock when
- * two SynchronizedBooleans attempt to simultaneously swap with each other.
- * (Note: Ordering via identyHashCode is not strictly guaranteed
- * by the language specification to return unique, orderable
- * values, but in practice JVMs rely on them being unique.)
- * @return the new value
- **/
-
- public boolean swap(SynchronizedBoolean other) {
- if (other == this) return get();
- SynchronizedBoolean fst = this;
- SynchronizedBoolean snd = other;
- if (System.identityHashCode(fst) > System.identityHashCode(snd)) {
- fst = other;
- snd = this;
- }
- synchronized(fst.lock_) {
- synchronized(snd.lock_) {
- fst.set(snd.set(fst.get()));
- return get();
- }
- }
- }
-
- /**
- * Set the value to its complement
- * @return the new value
- **/
- public boolean complement() {
- synchronized (lock_) {
- value_ = !value_;
- return value_;
- }
- }
-
- /**
- * Set value to value & b.
- * @return the new value
- **/
- public boolean and(boolean b) {
- synchronized (lock_) {
- value_ = value_ & b;
- return value_;
- }
- }
-
- /**
- * Set value to value | b.
- * @return the new value
- **/
- public boolean or(boolean b) {
- synchronized (lock_) {
- value_ = value_ | b;
- return value_;
- }
- }
-
-
- /**
- * Set value to value ^ b.
- * @return the new value
- **/
- public boolean xor(boolean b) {
- synchronized (lock_) {
- value_ = value_ ^ b;
- return value_;
- }
- }
-
-
- public int compareTo(boolean other) {
- boolean val = get();
- return (val == other)? 0 : (val)? 1 : -1;
- }
-
- public int compareTo(SynchronizedBoolean other) {
- return compareTo(other.get());
- }
-
- public int compareTo(Object other) {
- return compareTo((SynchronizedBoolean)other);
- }
-
-
- @Override // GemStoneAddition
- public boolean equals(Object other) {
- if (other != null &&
- other instanceof SynchronizedBoolean)
- return get() == ((SynchronizedBoolean)other).get();
- else
- return false;
- }
-
- @Override // GemStoneAddition
- public int hashCode() {
- boolean b = get();
- return (b)? 3412688 : 8319343; // entirely arbitrary
- }
-
- @Override // GemStoneAddition
- public String toString() { return String.valueOf(get()); }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedByte.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedByte.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedByte.java
deleted file mode 100644
index 87d1aff..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedByte.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SynchronizedByte.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 19Jun1998 dl Create public version
- 15Apr2003 dl Removed redundant "synchronized" for multiply()
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * A class useful for offloading synch for byte instance variables.
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-
-public class SynchronizedByte extends SynchronizedVariable implements Comparable, Cloneable {
-
- protected byte value_;
-
- /**
- * Make a new SynchronizedByte with the given initial value,
- * and using its own internal lock.
- **/
- public SynchronizedByte(byte initialValue) {
- super();
- value_ = initialValue;
- }
-
- /**
- * Make a new SynchronizedByte with the given initial value,
- * and using the supplied lock.
- **/
- public SynchronizedByte(byte initialValue, Object lock) {
- super(lock);
- value_ = initialValue;
- }
-
- /**
- * Return the current value
- **/
- public final byte get() { synchronized(lock_) { return value_; } }
-
- /**
- * Set to newValue.
- * @return the old value
- **/
-
- public byte set(byte newValue) {
- synchronized (lock_) {
- byte old = value_;
- value_ = newValue;
- return old;
- }
- }
-
- /**
- * Set value to newValue only if it is currently assumedValue.
- * @return true if successful
- **/
- public boolean commit(byte assumedValue, byte newValue) {
- synchronized(lock_) {
- boolean success = (assumedValue == value_);
- if (success) value_ = newValue;
- return success;
- }
- }
-
-
- /**
- * Atomically swap values with another SynchronizedByte.
- * Uses identityHashCode to avoid deadlock when
- * two SynchronizedBytes attempt to simultaneously swap with each other.
- * (Note: Ordering via identyHashCode is not strictly guaranteed
- * by the language specification to return unique, orderable
- * values, but in practice JVMs rely on them being unique.)
- * @return the new value
- **/
-
- public byte swap(SynchronizedByte other) {
- if (other == this) return get();
- SynchronizedByte fst = this;
- SynchronizedByte snd = other;
- if (System.identityHashCode(fst) > System.identityHashCode(snd)) {
- fst = other;
- snd = this;
- }
- synchronized(fst.lock_) {
- synchronized(snd.lock_) {
- fst.set(snd.set(fst.get()));
- return get();
- }
- }
- }
-
- /**
- * Increment the value.
- * @return the new value
- **/
- public byte increment() {
- synchronized (lock_) {
- return ++value_;
- }
- }
-
- /**
- * Decrement the value.
- * @return the new value
- **/
- public byte decrement() {
- synchronized (lock_) {
- return --value_;
- }
- }
-
- /**
- * Add amount to value (i.e., set value += amount)
- * @return the new value
- **/
- public byte add(byte amount) {
- synchronized (lock_) {
- return value_ += amount;
- }
- }
-
- /**
- * Subtract amount from value (i.e., set value -= amount)
- * @return the new value
- **/
- public byte subtract(byte amount) {
- synchronized (lock_) {
- return value_ -= amount;
- }
- }
-
- /**
- * Multiply value by factor (i.e., set value *= factor)
- * @return the new value
- **/
- public byte multiply(byte factor) {
- synchronized (lock_) {
- return value_ *= factor;
- }
- }
-
- /**
- * Divide value by factor (i.e., set value /= factor)
- * @return the new value
- **/
- public byte divide(byte factor) {
- synchronized (lock_) {
- return value_ /= factor;
- }
- }
-
- /**
- * Set the value to the negative of its old value
- * @return the new value
- **/
- public byte negate() {
- synchronized (lock_) {
- value_ = (byte)(-value_);
- return value_;
- }
- }
-
- /**
- * Set the value to its complement
- * @return the new value
- **/
- public byte complement() {
- synchronized (lock_) {
- value_ = (byte)~value_;
- return value_;
- }
- }
-
- /**
- * Set value to value & b.
- * @return the new value
- **/
- public byte and(byte b) {
- synchronized (lock_) {
- value_ = (byte)(value_ & b);
- return value_;
- }
- }
-
- /**
- * Set value to value | b.
- * @return the new value
- **/
- public byte or(byte b) {
- synchronized (lock_) {
- value_ = (byte)(value_ | b);
- return value_;
- }
- }
-
-
- /**
- * Set value to value ^ b.
- * @return the new value
- **/
- public byte xor(byte b) {
- synchronized (lock_) {
- value_ = (byte)(value_ ^ b);
- return value_;
- }
- }
-
- public int compareTo(byte other) {
- byte val = get();
- return (val < other)? -1 : (val == other)? 0 : 1;
- }
-
- public int compareTo(SynchronizedByte other) {
- return compareTo(other.get());
- }
-
- public int compareTo(Object other) {
- return compareTo((SynchronizedByte)other);
- }
-
- @Override // GemStoneAddition
- public boolean equals(Object other) {
- if (other != null &&
- other instanceof SynchronizedByte)
- return get() == ((SynchronizedByte)other).get();
- else
- return false;
- }
-
- @Override // GemStoneAddition
- public int hashCode() {
- return /*(int) GemStoneAddition*/(get());
- }
-
- @Override // GemStoneAddition
- public String toString() { return Byte.toString(get()); }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedChar.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedChar.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedChar.java
deleted file mode 100644
index 62a92d6..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedChar.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SynchronizedChar.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 19Jun1998 dl Create public version
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * A class useful for offloading synch for char instance variables.
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-
-public class SynchronizedChar extends SynchronizedVariable implements Comparable, Cloneable {
-
- protected char value_;
-
- /**
- * Make a new SynchronizedChar with the given initial value,
- * and using its own internal lock.
- **/
- public SynchronizedChar(char initialValue) {
- super();
- value_ = initialValue;
- }
-
- /**
- * Make a new SynchronizedChar with the given initial value,
- * and using the supplied lock.
- **/
- public SynchronizedChar(char initialValue, Object lock) {
- super(lock);
- value_ = initialValue;
- }
-
- /**
- * Return the current value
- **/
- public final char get() { synchronized(lock_) { return value_; } }
-
- /**
- * Set to newValue.
- * @return the old value
- **/
-
- public char set(char newValue) {
- synchronized (lock_) {
- char old = value_;
- value_ = newValue;
- return old;
- }
- }
-
- /**
- * Set value to newValue only if it is currently assumedValue.
- * @return true if successful
- **/
- public boolean commit(char assumedValue, char newValue) {
- synchronized(lock_) {
- boolean success = (assumedValue == value_);
- if (success) value_ = newValue;
- return success;
- }
- }
-
-
- /**
- * Atomically swap values with another SynchronizedChar.
- * Uses identityHashCode to avoid deadlock when
- * two SynchronizedChars attempt to simultaneously swap with each other.
- * (Note: Ordering via identyHashCode is not strictly guaranteed
- * by the language specification to return unique, orderable
- * values, but in practice JVMs rely on them being unique.)
- * @return the new value
- **/
-
- public char swap(SynchronizedChar other) {
- if (other == this) return get();
- SynchronizedChar fst = this;
- SynchronizedChar snd = other;
- if (System.identityHashCode(fst) > System.identityHashCode(snd)) {
- fst = other;
- snd = this;
- }
- synchronized(fst.lock_) {
- synchronized(snd.lock_) {
- fst.set(snd.set(fst.get()));
- return get();
- }
- }
- }
-
- /**
- * Add amount to value (i.e., set value += amount)
- * @return the new value
- **/
- public char add(char amount) {
- synchronized (lock_) {
- return value_ += amount;
- }
- }
-
- /**
- * Subtract amount from value (i.e., set value -= amount)
- * @return the new value
- **/
- public char subtract(char amount) {
- synchronized (lock_) {
- return value_ -= amount;
- }
- }
-
- /**
- * Multiply value by factor (i.e., set value *= factor)
- * @return the new value
- **/
- public synchronized char multiply(char factor) {
- synchronized (lock_) {
- return value_ *= factor;
- }
- }
-
- /**
- * Divide value by factor (i.e., set value /= factor)
- * @return the new value
- **/
- public char divide(char factor) {
- synchronized (lock_) {
- return value_ /= factor;
- }
- }
-
- public int compareTo(char other) {
- char val = get();
- return (val < other)? -1 : (val == other)? 0 : 1;
- }
-
- public int compareTo(SynchronizedChar other) {
- return compareTo(other.get());
- }
-
- public int compareTo(Object other) {
- return compareTo((SynchronizedChar)other);
- }
-
- @Override // GemStoneAddition
- public boolean equals(Object other) {
- if (other != null &&
- other instanceof SynchronizedChar)
- return get() == ((SynchronizedChar)other).get();
- else
- return false;
- }
-
- @Override // GemStoneAddition
- public int hashCode() { // same hash as Char
- return /*(int) GemStoneAddition */(get());
- }
-
- @Override // GemStoneAddition
- public String toString() { return String.valueOf(get()); }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedDouble.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedDouble.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedDouble.java
deleted file mode 100644
index 7fcc058..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedDouble.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SynchronizedDouble.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 19Jun1998 dl Create public version
- 15Apr2003 dl Removed redundant "synchronized" for multiply()
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
-/**
- * A class useful for offloading synch for double instance variables.
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-@SuppressFBWarnings(value="FE_FLOATING_POINT_EQUALITY",justification="GemFire doesn't use this class")
-public class SynchronizedDouble extends SynchronizedVariable implements Comparable, Cloneable {
-
- protected double value_;
-
- /**
- * Make a new SynchronizedDouble with the given initial value,
- * and using its own internal lock.
- **/
- public SynchronizedDouble(double initialValue) {
- super();
- value_ = initialValue;
- }
-
- /**
- * Make a new SynchronizedDouble with the given initial value,
- * and using the supplied lock.
- **/
- public SynchronizedDouble(double initialValue, Object lock) {
- super(lock);
- value_ = initialValue;
- }
-
- /**
- * Return the current value
- **/
- public final double get() { synchronized(lock_) { return value_; } }
-
- /**
- * Set to newValue.
- * @return the old value
- **/
-
- public double set(double newValue) {
- synchronized (lock_) {
- double old = value_;
- value_ = newValue;
- return old;
- }
- }
-
- /**
- * Set value to newValue only if it is currently assumedValue.
- * @return true if successful
- **/
- public boolean commit(double assumedValue, double newValue) {
- synchronized(lock_) {
- boolean success = (assumedValue == value_);
- if (success) value_ = newValue;
- return success;
- }
- }
-
-
- /**
- * Atomically swap values with another SynchronizedDouble.
- * Uses identityHashCode to avoid deadlock when
- * two SynchronizedDoubles attempt to simultaneously swap with each other.
- * (Note: Ordering via identyHashCode is not strictly guaranteed
- * by the language specification to return unique, orderable
- * values, but in practice JVMs rely on them being unique.)
- * @return the new value
- **/
-
- public double swap(SynchronizedDouble other) {
- if (other == this) return get();
- SynchronizedDouble fst = this;
- SynchronizedDouble snd = other;
- if (System.identityHashCode(fst) > System.identityHashCode(snd)) {
- fst = other;
- snd = this;
- }
- synchronized(fst.lock_) {
- synchronized(snd.lock_) {
- fst.set(snd.set(fst.get()));
- return get();
- }
- }
- }
-
-
- /**
- * Add amount to value (i.e., set value += amount)
- * @return the new value
- **/
- public double add(double amount) {
- synchronized (lock_) {
- return value_ += amount;
- }
- }
-
- /**
- * Subtract amount from value (i.e., set value -= amount)
- * @return the new value
- **/
- public double subtract(double amount) {
- synchronized (lock_) {
- return value_ -= amount;
- }
- }
-
- /**
- * Multiply value by factor (i.e., set value *= factor)
- * @return the new value
- **/
- public double multiply(double factor) {
- synchronized (lock_) {
- return value_ *= factor;
- }
- }
-
- /**
- * Divide value by factor (i.e., set value /= factor)
- * @return the new value
- **/
- public double divide(double factor) {
- synchronized (lock_) {
- return value_ /= factor;
- }
- }
-
- public int compareTo(double other) {
- double val = get();
- return (val < other)? -1 : (val == other)? 0 : 1;
- }
-
- public int compareTo(SynchronizedDouble other) {
- return compareTo(other.get());
- }
-
- public int compareTo(Object other) {
- return compareTo((SynchronizedDouble)other);
- }
-
- @Override // GemStoneAddition
- public boolean equals(Object other) {
- if (other != null &&
- other instanceof SynchronizedDouble)
- return get() == ((SynchronizedDouble)other).get();
- else
- return false;
- }
-
- @Override // GemStoneAddition
- public int hashCode() { // same hash as Double
- long bits = Double.doubleToLongBits(get());
- return (int)(bits ^ (bits >> 32));
- }
-
- @Override // GemStoneAddition
- public String toString() { return String.valueOf(get()); }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedFloat.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedFloat.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedFloat.java
deleted file mode 100644
index efba411..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedFloat.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SynchronizedFloat.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 19Jun1998 dl Create public version
- 15Apr2003 dl Removed redundant "synchronized" for multiply()
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
-/**
- * A class useful for offloading synch for float instance variables.
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-
-public class SynchronizedFloat extends SynchronizedVariable implements Comparable, Cloneable {
-
- protected float value_;
-
- /**
- * Make a new SynchronizedFloat with the given initial value,
- * and using its own internal lock.
- **/
- public SynchronizedFloat(float initialValue) {
- super();
- value_ = initialValue;
- }
-
- /**
- * Make a new SynchronizedFloat with the given initial value,
- * and using the supplied lock.
- **/
- public SynchronizedFloat(float initialValue, Object lock) {
- super(lock);
- value_ = initialValue;
- }
-
- /**
- * Return the current value
- **/
- public final float get() { synchronized(lock_) { return value_; } }
-
- /**
- * Set to newValue.
- * @return the old value
- **/
-
- public float set(float newValue) {
- synchronized (lock_) {
- float old = value_;
- value_ = newValue;
- return old;
- }
- }
-
- /**
- * Set value to newValue only if it is currently assumedValue.
- * @return true if successful
- **/
- @SuppressFBWarnings(value="FE_FLOATING_POINT_EQUALITY", justification="GemFire does not use this class")
- public boolean commit(float assumedValue, float newValue) {
- synchronized(lock_) {
- boolean success = (assumedValue == value_);
- if (success) value_ = newValue;
- return success;
- }
- }
-
-
- /**
- * Atomically swap values with another SynchronizedFloat.
- * Uses identityHashCode to avoid deadlock when
- * two SynchronizedFloats attempt to simultaneously swap with each other.
- * (Note: Ordering via identyHashCode is not strictly guaranteed
- * by the language specification to return unique, orderable
- * values, but in practice JVMs rely on them being unique.)
- * @return the new value
- **/
-
- public float swap(SynchronizedFloat other) {
- if (other == this) return get();
- SynchronizedFloat fst = this;
- SynchronizedFloat snd = other;
- if (System.identityHashCode(fst) > System.identityHashCode(snd)) {
- fst = other;
- snd = this;
- }
- synchronized(fst.lock_) {
- synchronized(snd.lock_) {
- fst.set(snd.set(fst.get()));
- return get();
- }
- }
- }
-
-
- /**
- * Add amount to value (i.e., set value += amount)
- * @return the new value
- **/
- public float add(float amount) {
- synchronized (lock_) {
- return value_ += amount;
- }
- }
-
- /**
- * Subtract amount from value (i.e., set value -= amount)
- * @return the new value
- **/
- public float subtract(float amount) {
- synchronized (lock_) {
- return value_ -= amount;
- }
- }
-
- /**
- * Multiply value by factor (i.e., set value *= factor)
- * @return the new value
- **/
- public float multiply(float factor) {
- synchronized (lock_) {
- return value_ *= factor;
- }
- }
-
- /**
- * Divide value by factor (i.e., set value /= factor)
- * @return the new value
- **/
- public float divide(float factor) {
- synchronized (lock_) {
- return value_ /= factor;
- }
- }
-
- public int compareTo(float other) {
- float val = get();
- return (val < other)? -1 : (val == other)? 0 : 1;
- }
-
- public int compareTo(SynchronizedFloat other) {
- return compareTo(other.get());
- }
-
- public int compareTo(Object other) {
- return compareTo((SynchronizedFloat)other);
- }
-
- @Override // GemStoneAddition
- public boolean equals(Object other) {
- if (other != null &&
- other instanceof SynchronizedFloat)
- return get() == ((SynchronizedFloat)other).get();
- else
- return false;
- }
-
- @Override // GemStoneAddition
- public int hashCode() {
- return Float.floatToIntBits(get());
- }
-
- @Override // GemStoneAddition
- public String toString() { return String.valueOf(get()); }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedInt.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedInt.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedInt.java
deleted file mode 100644
index 8841890..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedInt.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SynchronizedInt.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 19Jun1998 dl Create public version
- 15Apr2003 dl Removed redundant "synchronized" for multiply()
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * A class useful for offloading synch for int instance variables.
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-
-public class SynchronizedInt extends SynchronizedVariable implements Comparable, Cloneable {
-
- protected int value_;
-
- /**
- * Make a new SynchronizedInt with the given initial value,
- * and using its own internal lock.
- **/
- public SynchronizedInt(int initialValue) {
- super();
- value_ = initialValue;
- }
-
- /**
- * Make a new SynchronizedInt with the given initial value,
- * and using the supplied lock.
- **/
- public SynchronizedInt(int initialValue, Object lock) {
- super(lock);
- value_ = initialValue;
- }
-
- /**
- * Return the current value
- **/
- public final int get() { synchronized(lock_) { return value_; } }
-
- /**
- * Set to newValue.
- * @return the old value
- **/
-
- public int set(int newValue) {
- synchronized (lock_) {
- int old = value_;
- value_ = newValue;
- return old;
- }
- }
-
- /**
- * Set value to newValue only if it is currently assumedValue.
- * @return true if successful
- **/
- public boolean commit(int assumedValue, int newValue) {
- synchronized(lock_) {
- boolean success = (assumedValue == value_);
- if (success) value_ = newValue;
- return success;
- }
- }
-
- /**
- * Atomically swap values with another SynchronizedInt.
- * Uses identityHashCode to avoid deadlock when
- * two SynchronizedInts attempt to simultaneously swap with each other.
- * (Note: Ordering via identyHashCode is not strictly guaranteed
- * by the language specification to return unique, orderable
- * values, but in practice JVMs rely on them being unique.)
- * @return the new value
- **/
-
- public int swap(SynchronizedInt other) {
- if (other == this) return get();
- SynchronizedInt fst = this;
- SynchronizedInt snd = other;
- if (System.identityHashCode(fst) > System.identityHashCode(snd)) {
- fst = other;
- snd = this;
- }
- synchronized(fst.lock_) {
- synchronized(snd.lock_) {
- fst.set(snd.set(fst.get()));
- return get();
- }
- }
- }
-
- /**
- * Increment the value.
- * @return the new value
- **/
- public int increment() {
- synchronized (lock_) {
- return ++value_;
- }
- }
-
- /**
- * Decrement the value.
- * @return the new value
- **/
- public int decrement() {
- synchronized (lock_) {
- return --value_;
- }
- }
-
- /**
- * Add amount to value (i.e., set value += amount)
- * @return the new value
- **/
- public int add(int amount) {
- synchronized (lock_) {
- return value_ += amount;
- }
- }
-
- /**
- * Subtract amount from value (i.e., set value -= amount)
- * @return the new value
- **/
- public int subtract(int amount) {
- synchronized (lock_) {
- return value_ -= amount;
- }
- }
-
- /**
- * Multiply value by factor (i.e., set value *= factor)
- * @return the new value
- **/
- public int multiply(int factor) {
- synchronized (lock_) {
- return value_ *= factor;
- }
- }
-
- /**
- * Divide value by factor (i.e., set value /= factor)
- * @return the new value
- **/
- public int divide(int factor) {
- synchronized (lock_) {
- return value_ /= factor;
- }
- }
-
- /**
- * Set the value to the negative of its old value
- * @return the new value
- **/
- public int negate() {
- synchronized (lock_) {
- value_ = -value_;
- return value_;
- }
- }
-
- /**
- * Set the value to its complement
- * @return the new value
- **/
- public int complement() {
- synchronized (lock_) {
- value_ = ~value_;
- return value_;
- }
- }
-
- /**
- * Set value to value & b.
- * @return the new value
- **/
- public int and(int b) {
- synchronized (lock_) {
- value_ = value_ & b;
- return value_;
- }
- }
-
- /**
- * Set value to value | b.
- * @return the new value
- **/
- public int or(int b) {
- synchronized (lock_) {
- value_ = value_ | b;
- return value_;
- }
- }
-
-
- /**
- * Set value to value ^ b.
- * @return the new value
- **/
- public int xor(int b) {
- synchronized (lock_) {
- value_ = value_ ^ b;
- return value_;
- }
- }
-
- public int compareTo(int other) {
- int val = get();
- return (val < other)? -1 : (val == other)? 0 : 1;
- }
-
- public int compareTo(SynchronizedInt other) {
- return compareTo(other.get());
- }
-
- public int compareTo(Object other) {
- return compareTo((SynchronizedInt)other);
- }
-
- @Override // GemStoneAddition
- public boolean equals(Object other) {
- if (other != null &&
- other instanceof SynchronizedInt)
- return get() == ((SynchronizedInt)other).get();
- else
- return false;
- }
-
- @Override // GemStoneAddition
- public int hashCode() { return get(); }
-
- @Override // GemStoneAddition
- public String toString() { return String.valueOf(get()); }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedLong.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedLong.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedLong.java
deleted file mode 100644
index 56339a1..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedLong.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SynchronizedLong.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 19Jun1998 dl Create public version
- 15Apr2003 dl Removed redundant "synchronized" for multiply()
- 23jan04 dl synchronize self-swap case for swap
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * A class useful for offloading synch for long instance variables.
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-
-public class SynchronizedLong extends SynchronizedVariable implements Comparable, Cloneable {
-
- protected long value_;
-
- /**
- * Make a new SynchronizedLong with the given initial value,
- * and using its own internal lock.
- **/
- public SynchronizedLong(long initialValue) {
- super();
- value_ = initialValue;
- }
-
- /**
- * Make a new SynchronizedLong with the given initial value,
- * and using the supplied lock.
- **/
- public SynchronizedLong(long initialValue, Object lock) {
- super(lock);
- value_ = initialValue;
- }
-
- /**
- * Return the current value
- **/
- public final long get() { synchronized(lock_) { return value_; } }
-
- /**
- * Set to newValue.
- * @return the old value
- **/
-
- public long set(long newValue) {
- synchronized (lock_) {
- long old = value_;
- value_ = newValue;
- return old;
- }
- }
-
- /**
- * Set value to newValue only if it is currently assumedValue.
- * @return true if successful
- **/
- public boolean commit(long assumedValue, long newValue) {
- synchronized(lock_) {
- boolean success = (assumedValue == value_);
- if (success) value_ = newValue;
- return success;
- }
- }
-
- /**
- * Atomically swap values with another SynchronizedLong.
- * Uses identityHashCode to avoid deadlock when
- * two SynchronizedLongs attempt to simultaneously swap with each other.
- * @return the new value
- **/
-
- public long swap(SynchronizedLong other) {
- if (other == this) return get();
- SynchronizedLong fst = this;
- SynchronizedLong snd = other;
- if (System.identityHashCode(fst) > System.identityHashCode(snd)) {
- fst = other;
- snd = this;
- }
- synchronized(fst.lock_) {
- synchronized(snd.lock_) {
- fst.set(snd.set(fst.get()));
- return get();
- }
- }
- }
-
- /**
- * Increment the value.
- * @return the new value
- **/
- public long increment() {
- synchronized (lock_) {
- return ++value_;
- }
- }
-
- /**
- * Decrement the value.
- * @return the new value
- **/
- public long decrement() {
- synchronized (lock_) {
- return --value_;
- }
- }
-
- /**
- * Add amount to value (i.e., set value += amount)
- * @return the new value
- **/
- public long add(long amount) {
- synchronized (lock_) {
- return value_ += amount;
- }
- }
-
- /**
- * Subtract amount from value (i.e., set value -= amount)
- * @return the new value
- **/
- public long subtract(long amount) {
- synchronized (lock_) {
- return value_ -= amount;
- }
- }
-
- /**
- * Multiply value by factor (i.e., set value *= factor)
- * @return the new value
- **/
- public long multiply(long factor) {
- synchronized (lock_) {
- return value_ *= factor;
- }
- }
-
- /**
- * Divide value by factor (i.e., set value /= factor)
- * @return the new value
- **/
- public long divide(long factor) {
- synchronized (lock_) {
- return value_ /= factor;
- }
- }
-
- /**
- * Set the value to the negative of its old value
- * @return the new value
- **/
- public long negate() {
- synchronized (lock_) {
- value_ = -value_;
- return value_;
- }
- }
-
- /**
- * Set the value to its complement
- * @return the new value
- **/
- public long complement() {
- synchronized (lock_) {
- value_ = ~value_;
- return value_;
- }
- }
-
- /**
- * Set value to value & b.
- * @return the new value
- **/
- public long and(long b) {
- synchronized (lock_) {
- value_ = value_ & b;
- return value_;
- }
- }
-
- /**
- * Set value to value | b.
- * @return the new value
- **/
- public long or(long b) {
- synchronized (lock_) {
- value_ = value_ | b;
- return value_;
- }
- }
-
-
- /**
- * Set value to value ^ b.
- * @return the new value
- **/
- public long xor(long b) {
- synchronized (lock_) {
- value_ = value_ ^ b;
- return value_;
- }
- }
-
-
- public int compareTo(long other) {
- long val = get();
- return (val < other)? -1 : (val == other)? 0 : 1;
- }
-
- public int compareTo(SynchronizedLong other) {
- return compareTo(other.get());
- }
-
- public int compareTo(Object other) {
- return compareTo((SynchronizedLong)other);
- }
-
- @Override // GemStoneAddition
- public boolean equals(Object other) {
- if (other != null &&
- other instanceof SynchronizedLong)
- return get() == ((SynchronizedLong)other).get();
- else
- return false;
- }
-
- @Override // GemStoneAddition
- public int hashCode() { // same expression as java.lang.Long
- long v = get();
- return (int)(v ^ (v >> 32));
- }
-
- @Override // GemStoneAddition
- public String toString() { return String.valueOf(get()); }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedRef.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedRef.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedRef.java
deleted file mode 100644
index f03865b..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedRef.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SynchronizedRef.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 11Jun1998 dl Create public version
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * A simple class maintaining a single reference variable that
- * is always accessed and updated under synchronization.
- * <p>
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-
-public class SynchronizedRef extends SynchronizedVariable {
- /** The maintained reference **/
- protected Object value_;
-
- /**
- * Create a SynchronizedRef initially holding the given reference
- * and using its own internal lock.
- **/
- public SynchronizedRef(Object initialValue) {
- super();
- value_ = initialValue;
- }
-
- /**
- * Make a new SynchronizedRef with the given initial value,
- * and using the supplied lock.
- **/
- public SynchronizedRef(Object initialValue, Object lock) {
- super(lock);
- value_ = initialValue;
- }
-
- /**
- * Return the current value
- **/
- public final Object get() { synchronized(lock_) { return value_; } }
-
- /**
- * Set to newValue.
- * @return the old value
- **/
-
- public Object set(Object newValue) {
- synchronized (lock_) {
- Object old = value_;
- value_ = newValue;
- return old;
- }
- }
-
- /**
- * Set value to newValue only if it is currently assumedValue.
- * @return true if successful
- **/
- public boolean commit(Object assumedValue, Object newValue) {
- synchronized(lock_) {
- boolean success = (assumedValue == value_);
- if (success) value_ = newValue;
- return success;
- }
- }
-
-
- /**
- * Atomically swap values with another SynchronizedRef.
- * Uses identityHashCode to avoid deadlock when
- * two SynchronizedRefs attempt to simultaneously swap with each other.
- * (Note: Ordering via identyHashCode is not strictly guaranteed
- * by the language specification to return unique, orderable
- * values, but in practice JVMs rely on them being unique.)
- * @return the new value
- **/
-
- public Object swap(SynchronizedRef other) {
- if (other == this) return get();
- SynchronizedRef fst = this;
- SynchronizedRef snd = other;
- if (System.identityHashCode(fst) > System.identityHashCode(snd)) {
- fst = other;
- snd = this;
- }
- synchronized(fst.lock_) {
- synchronized(snd.lock_) {
- fst.set(snd.set(fst.get()));
- return get();
- }
- }
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedShort.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedShort.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedShort.java
deleted file mode 100644
index aa86a8f..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedShort.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SynchronizedShort.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 19Jun1998 dl Create public version
- 15Apr2003 dl Removed redundant "synchronized" for multiply()
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * A class useful for offloading synch for short instance variables.
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-
-public class SynchronizedShort extends SynchronizedVariable implements Comparable, Cloneable {
-
- protected short value_;
-
- /**
- * Make a new SynchronizedShort with the given initial value,
- * and using its own internal lock.
- **/
- public SynchronizedShort(short initialValue) {
- super();
- value_ = initialValue;
- }
-
- /**
- * Make a new SynchronizedShort with the given initial value,
- * and using the supplied lock.
- **/
- public SynchronizedShort(short initialValue, Object lock) {
- super(lock);
- value_ = initialValue;
- }
-
- /**
- * Return the current value
- **/
- public final short get() { synchronized(lock_) { return value_; } }
-
- /**
- * Set to newValue.
- * @return the old value
- **/
-
- public short set(short newValue) {
- synchronized (lock_) {
- short old = value_;
- value_ = newValue;
- return old;
- }
- }
-
- /**
- * Set value to newValue only if it is currently assumedValue.
- * @return true if successful
- **/
- public boolean commit(short assumedValue, short newValue) {
- synchronized(lock_) {
- boolean success = (assumedValue == value_);
- if (success) value_ = newValue;
- return success;
- }
- }
-
-
- /**
- * Atomically swap values with another SynchronizedShort.
- * Uses identityHashCode to avoid deadlock when
- * two SynchronizedShorts attempt to simultaneously swap with each other.
- * (Note: Ordering via identyHashCode is not strictly guaranteed
- * by the language specification to return unique, orderable
- * values, but in practice JVMs rely on them being unique.)
- * @return the new value
- **/
-
- public short swap(SynchronizedShort other) {
- if (other == this) return get();
- SynchronizedShort fst = this;
- SynchronizedShort snd = other;
- if (System.identityHashCode(fst) > System.identityHashCode(snd)) {
- fst = other;
- snd = this;
- }
- synchronized(fst.lock_) {
- synchronized(snd.lock_) {
- fst.set(snd.set(fst.get()));
- return get();
- }
- }
- }
-
-
- /**
- * Increment the value.
- * @return the new value
- **/
- public short increment() {
- synchronized (lock_) {
- return ++value_;
- }
- }
-
- /**
- * Decrement the value.
- * @return the new value
- **/
- public short decrement() {
- synchronized (lock_) {
- return --value_;
- }
- }
-
- /**
- * Add amount to value (i.e., set value += amount)
- * @return the new value
- **/
- public short add(short amount) {
- synchronized (lock_) {
- return value_ += amount;
- }
- }
-
- /**
- * Subtract amount from value (i.e., set value -= amount)
- * @return the new value
- **/
- public short subtract(short amount) {
- synchronized (lock_) {
- return value_ -= amount;
- }
- }
-
- /**
- * Multiply value by factor (i.e., set value *= factor)
- * @return the new value
- **/
- public short multiply(short factor) {
- synchronized (lock_) {
- return value_ *= factor;
- }
- }
-
- /**
- * Divide value by factor (i.e., set value /= factor)
- * @return the new value
- **/
- public short divide(short factor) {
- synchronized (lock_) {
- return value_ /= factor;
- }
- }
-
- /**
- * Set the value to the negative of its old value
- * @return the new value
- **/
- public short negate() {
- synchronized (lock_) {
- value_ = (short)(-value_);
- return value_;
- }
- }
-
- /**
- * Set the value to its complement
- * @return the new value
- **/
- public short complement() {
- synchronized (lock_) {
- value_ = (short)(~value_);
- return value_;
- }
- }
-
- /**
- * Set value to value & b.
- * @return the new value
- **/
- public short and(short b) {
- synchronized (lock_) {
- value_ = (short)(value_ & b);
- return value_;
- }
- }
-
- /**
- * Set value to value | b.
- * @return the new value
- **/
- public short or(short b) {
- synchronized (lock_) {
- value_ = (short)(value_ | b);
- return value_;
- }
- }
-
-
- /**
- * Set value to value ^ b.
- * @return the new value
- **/
- public short xor(short b) {
- synchronized (lock_) {
- value_ = (short)(value_ ^ b);
- return value_;
- }
- }
-
- public int compareTo(short other) {
- short val = get();
- return (val < other)? -1 : (val == other)? 0 : 1;
- }
-
- public int compareTo(SynchronizedShort other) {
- return compareTo(other.get());
- }
-
- public int compareTo(Object other) {
- return compareTo((SynchronizedShort)other);
- }
-
- @Override // GemStoneAddition
- public boolean equals(Object other) {
- if (other != null &&
- other instanceof SynchronizedShort)
- return get() == ((SynchronizedShort)other).get();
- else
- return false;
- }
-
- @Override // GemStoneAddition
- public int hashCode() {
- return /*(int) GemStoneAddition */ (get());
- }
-
- @Override // GemStoneAddition
- public String toString() { return String.valueOf(get()); }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedVariable.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedVariable.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedVariable.java
deleted file mode 100644
index 176d3c1..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronizedVariable.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SynchronizedVariable.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 30Jun1998 dl Create public version
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * Base class for simple, small classes
- * maintaining single values that are always accessed
- * and updated under synchronization. Since defining them for only
- * some types seemed too arbitrary, they exist for all basic types,
- * although it is hard to imagine uses for some.
- * <p>
- * These classes mainly exist so that you do not have to go to the
- * trouble of writing your own miscellaneous classes and methods
- * in situations including:
- * <ul>
- * <li> When you need or want to offload an instance
- * variable to use its own synchronization lock.
- * When these objects are used to replace instance variables, they
- * should almost always be declared as <code>final</code>. This
- * helps avoid the need to synchronize just to obtain the reference
- * to the synchronized variable itself.
- *
- * <li> When you need methods such as set, commit, or swap.
- * Note however that
- * the synchronization for these variables is <em>independent</em>
- * of any other synchronization perfromed using other locks.
- * So, they are not
- * normally useful when accesses and updates among
- * variables must be coordinated.
- * For example, it would normally be a bad idea to make
- * a Point class out of two SynchronizedInts, even those
- * sharing a lock.
- *
- * <li> When defining <code>static</code> variables. It almost
- * always works out better to rely on synchronization internal
- * to these objects, rather than class locks.
- * </ul>
- * <p>
- * While they cannot, by nature, share much code,
- * all of these classes work in the same way.
- * <p>
- * <b>Construction</b> <br>
- * Synchronized variables are always constructed holding an
- * initial value of the associated type. Constructors also
- * establish the lock to use for all methods:
- * <ul>
- * <li> By default, each variable uses itself as the
- * synchronization lock. This is the most common
- * choice in the most common usage contexts in which
- * SynchronizedVariables are used to split off
- * synchronization locks for independent attributes
- * of a class.
- * <li> You can specify any other Object to use as the
- * synchronization lock. This allows you to
- * use various forms of `slave synchronization'. For
- * example, a variable that is always associated with a
- * particular object can use that object's lock.
- * </ul>
- * <p>
- * <b>Update methods</b><br>
- * Each class supports several kinds of update methods:
- * <ul>
- * <li> A <code>set</code> method that sets to a new value and returns
- * previous value. For example, for a SynchronizedBoolean b,
- * <code>boolean old = b.set(true)</code> performs a test-and-set.
- * <p>
- * <li> A <code>commit</code> method that sets to new value only
- * if currently holding a given value.
- *
- * For example, here is a class that uses an optimistic update
- * loop to recompute a count variable represented as a
- * SynchronizedInt.
- * <pre>
- * class X {
- * private final SynchronizedInt count = new SynchronizedInt(0);
- *
- * static final int MAX_RETRIES = 1000;
- *
- * public boolean recomputeCount() throws InterruptedException {
- * for (int i = 0; i < MAX_RETRIES; ++i) {
- * int current = count.get();
- * int next = compute(current);
- * if (count.commit(current, next))
- * return true;
- * else if (Thread.interrupted())
- * throw new InterruptedException();
- * }
- * return false;
- * }
- * int compute(int l) { ... some kind of computation ... }
- * }
- * </pre>
- * <p>
- * <li>A <code>swap</code> method that atomically swaps with another
- * object of the same class using a deadlock-avoidance strategy.
- * <p>
- * <li> Update-in-place methods appropriate to the type. All
- * numerical types support:
- * <ul>
- * <li> add(x) (equivalent to return value += x)
- * <li> subtract(x) (equivalent to return value -= x)
- * <li> multiply(x) (equivalent to return value *= x)
- * <li> divide(x) (equivalent to return value /= x)
- * </ul>
- * Integral types also support:
- * <ul>
- * <li> increment() (equivalent to return ++value)
- * <li> decrement() (equivalent to return --value)
- * </ul>
- * Boolean types support:
- * <ul>
- * <li> or(x) (equivalent to return value |= x)
- * <li> and(x) (equivalent to return value &= x)
- * <li> xor(x) (equivalent to return value ^= x)
- * <li> complement() (equivalent to return x = !x)
- * </ul>
- * These cover most, but not all of the possible operators in Java.
- * You can add more compute-and-set methods in subclasses. This
- * is often a good way to avoid the need for ad-hoc synchronized
- * blocks surrounding expressions.
- * </ul>
- * <p>
- * <b>Guarded methods</b> <br>
- * All <code>Waitable</code> subclasses provide notifications on
- * every value update, and support guarded methods of the form
- * <code>when</code><em>predicate</em>, that wait until the
- * predicate hold, then optionally run any Runnable action
- * within the lock, and then return. All types support:
- * <ul>
- * <li> whenEqual(value, action)
- * <li> whenNotEqual(value, action)
- * </ul>
- * (If the action argument is null, these return immediately
- * after the predicate holds.)
- * Numerical types also support
- * <ul>
- * <li> whenLess(value, action)
- * <li> whenLessEqual(value, action)
- * <li> whenGreater(value, action)
- * <li> whenGreaterEqual(value, action)
- * </ul>
- * The Waitable classes are not always spectacularly efficient since they
- * provide notifications on all value changes. They are
- * designed for use in contexts where either performance is not an
- * overriding issue, or where nearly every update releases guarded
- * waits anyway.
- * <p>
- * <b>Other methods</b> <br>
- * This class implements Executor, and provides an <code>execute</code>
- * method that runs the runnable within the lock.
- * <p>
- * All classes except SynchronizedRef and WaitableRef implement
- * <code>Cloneable</code> and <code>Comparable</code>.
- * Implementations of the corresponding
- * methods either use default mechanics, or use methods that closely
- * correspond to their java.lang analogs. SynchronizedRef does not
- * implement any of these standard interfaces because there are
- * many cases where it would not make sense. However, you can
- * easily make simple subclasses that add the appropriate declarations.
- *
- * <p>
- *
- *
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-
-public class SynchronizedVariable implements Executor {
-
- protected final Object lock_;
-
- /** Create a SynchronizedVariable using the supplied lock **/
- public SynchronizedVariable(Object lock) { lock_ = lock; }
-
- /** Create a SynchronizedVariable using itself as the lock **/
- public SynchronizedVariable() { lock_ = this; }
-
- /**
- * Return the lock used for all synchronization for this object
- **/
- public Object getLock() { return lock_; }
-
- /**
- * If current thread is not interrupted, execute the given command
- * within this object's lock
- **/
-
- public void execute(Runnable command) throws InterruptedException {
- if (Thread.interrupted()) throw new InterruptedException();
- synchronized (lock_) {
- command.run();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronousChannel.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronousChannel.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronousChannel.java
deleted file mode 100644
index 227fb87..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/SynchronousChannel.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: SynchronousChannel.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 11Jun1998 dl Create public version
- 17Jul1998 dl Disabled direct semaphore permit check
- 31Jul1998 dl Replaced main algorithm with one with
- better scaling and fairness properties.
- 25aug1998 dl added peek
- 24Nov2001 dl Replaced main algorithm with faster one.
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * A rendezvous channel, similar to those used in CSP and Ada. Each
- * put must wait for a take, and vice versa. Synchronous channels
- * are well suited for handoff designs, in which an object running in
- * one thread must synch up with an object running in another thread
- * in order to hand it some information, event, or task.
- * <p> If you only need threads to synch up without
- * exchanging information, consider using a Barrier. If you need
- * bidirectional exchanges, consider using a Rendezvous. <p>
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- * @see CyclicBarrier
- * @see Rendezvous
-**/
-
-public class SynchronousChannel implements BoundedChannel {
-
- /*
- This implementation divides actions into two cases for puts:
-
- * An arriving putter that does not already have a waiting taker
- creates a node holding item, and then waits for a taker to take it.
- * An arriving putter that does already have a waiting taker fills
- the slot node created by the taker, and notifies it to continue.
-
- And symmetrically, two for takes:
-
- * An arriving taker that does not already have a waiting putter
- creates an empty slot node, and then waits for a putter to fill it.
- * An arriving taker that does already have a waiting putter takes
- item from the node created by the putter, and notifies it to continue.
-
- This requires keeping two simple queues: waitingPuts and waitingTakes.
-
- When a put or take waiting for the actions of its counterpart
- aborts due to interruption or timeout, it marks the node
- it created as "CANCELLED", which causes its counterpart to retry
- the entire put or take sequence.
- */
-
- /**
- * Special marker used in queue nodes to indicate that
- * the thread waiting for a change in the node has timed out
- * or been interrupted.
- **/
- protected static final Object CANCELLED = new Object();
-
- /**
- * Simple FIFO queue class to hold waiting puts/takes.
- **/
- protected static class Queue {
- protected LinkedNode head;
- protected LinkedNode last;
-
- protected void enq(LinkedNode p) {
- if (last == null)
- last = head = p;
- else
- last = last.next = p;
- }
-
- protected LinkedNode deq() {
- LinkedNode p = head;
- if (p != null && (head = p.next) == null)
- last = null;
- return p;
- }
- }
-
- protected final Queue waitingPuts = new Queue();
- protected final Queue waitingTakes = new Queue();
-
- /**
- * @return zero --
- * Synchronous channels have no internal capacity.
- **/
- public int capacity() { return 0; }
-
- /**
- * @return null --
- * Synchronous channels do not hold contents unless actively taken
- **/
- public Object peek() { return null; }
-
-
- public void put(Object x) throws InterruptedException {
- if (x == null) throw new IllegalArgumentException();
-
- // This code is conceptually straightforward, but messy
- // because we need to intertwine handling of put-arrives first
- // vs take-arrives first cases.
-
- // Outer loop is to handle retry due to cancelled waiting taker
- for (;;) {
-
- // Get out now if we are interrupted
- if (Thread.interrupted()) throw new InterruptedException();
-
- // Exactly one of item or slot will be nonnull at end of
- // synchronized block, depending on whether a put or a take
- // arrived first.
- LinkedNode slot;
- LinkedNode item = null;
-
- synchronized(this) {
- // Try to match up with a waiting taker; fill and signal it below
- slot = waitingTakes.deq();
-
- // If no takers yet, create a node and wait below
- if (slot == null)
- waitingPuts.enq(item = new LinkedNode(x));
- }
-
- if (slot != null) { // There is a waiting taker.
- // Fill in the slot created by the taker and signal taker to
- // continue.
- synchronized(slot) {
- if (slot.value != CANCELLED) {
- slot.value = x;
- slot.notify();
- return;
- }
- // else the taker has cancelled, so retry outer loop
- }
- }
-
- else {
- // Wait for a taker to arrive and take the item.
- synchronized(item) {
- try {
- while (item.value != null)
- item.wait();
- return;
- }
- catch (InterruptedException ie) {
- // If item was taken, return normally but set interrupt status
- if (item.value == null) {
- Thread.currentThread().interrupt();
- return;
- }
- else {
- item.value = CANCELLED;
- throw ie;
- }
- }
- }
- }
- }
- }
-
- public Object take() throws InterruptedException {
- // Entirely symmetric to put()
-
- for (;;) {
- if (Thread.interrupted()) throw new InterruptedException();
-
- LinkedNode item;
- LinkedNode slot = null;
-
- synchronized(this) {
- item = waitingPuts.deq();
- if (item == null)
- waitingTakes.enq(slot = new LinkedNode());
- }
-
- if (item != null) {
- synchronized(item) {
- Object x = item.value;
- if (x != CANCELLED) {
- item.value = null;
- item.next = null;
- item.notify();
- return x;
- }
- }
- }
-
- else {
- synchronized(slot) {
- try {
- for (;;) {
- Object x = slot.value;
- if (x != null) {
- slot.value = null;
- slot.next = null;
- return x;
- }
- else
- slot.wait();
- }
- }
- catch(InterruptedException ie) {
- Object x = slot.value;
- if (x != null) {
- slot.value = null;
- slot.next = null;
- Thread.currentThread().interrupt();
- return x;
- }
- else {
- slot.value = CANCELLED;
- throw ie;
- }
- }
- }
- }
- }
- }
-
- /*
- Offer and poll are just like put and take, except even messier.
- */
-
-
- public boolean offer(Object x, long msecs) throws InterruptedException {
- if (x == null) throw new IllegalArgumentException();
- long waitTime = msecs;
- long startTime = 0; // lazily initialize below if needed
-
- for (;;) {
- if (Thread.interrupted()) throw new InterruptedException();
-
- LinkedNode slot;
- LinkedNode item = null;
-
- synchronized(this) {
- slot = waitingTakes.deq();
- if (slot == null) {
- if (waitTime <= 0)
- return false;
- else
- waitingPuts.enq(item = new LinkedNode(x));
- }
- }
-
- if (slot != null) {
- synchronized(slot) {
- if (slot.value != CANCELLED) {
- slot.value = x;
- slot.notify();
- return true;
- }
- }
- }
-
- long now = System.currentTimeMillis();
- if (startTime == 0)
- startTime = now;
- else
- waitTime = msecs - (now - startTime);
-
- if (item != null) {
- synchronized(item) {
- try {
- for (;;) {
- if (item.value == null)
- return true;
- if (waitTime <= 0) {
- item.value = CANCELLED;
- return false;
- }
- item.wait(waitTime);
- waitTime = msecs - (System.currentTimeMillis() - startTime);
- }
- }
- catch (InterruptedException ie) {
- if (item.value == null) {
- Thread.currentThread().interrupt();
- return true;
- }
- else {
- item.value = CANCELLED;
- throw ie;
- }
- }
- }
- }
- }
- }
-
- public Object poll(long msecs) throws InterruptedException {
- long waitTime = msecs;
- long startTime = 0;
-
- for (;;) {
- if (Thread.interrupted()) throw new InterruptedException();
-
- LinkedNode item;
- LinkedNode slot = null;
-
- synchronized(this) {
- item = waitingPuts.deq();
- if (item == null) {
- if (waitTime <= 0)
- return null;
- else
- waitingTakes.enq(slot = new LinkedNode());
- }
- }
-
- if (item != null) {
- synchronized(item) {
- Object x = item.value;
- if (x != CANCELLED) {
- item.value = null;
- item.next = null;
- item.notify();
- return x;
- }
- }
- }
-
- long now = System.currentTimeMillis();
- if (startTime == 0)
- startTime = now;
- else
- waitTime = msecs - (now - startTime);
-
- if (slot != null) {
- synchronized(slot) {
- try {
- for (;;) {
- Object x = slot.value;
- if (x != null) {
- slot.value = null;
- slot.next = null;
- return x;
- }
- if (waitTime <= 0) {
- slot.value = CANCELLED;
- return null;
- }
- slot.wait(waitTime);
- waitTime = msecs - (System.currentTimeMillis() - startTime);
- }
- }
- catch(InterruptedException ie) {
- Object x = slot.value;
- if (x != null) {
- slot.value = null;
- slot.next = null;
- Thread.currentThread().interrupt();
- return x;
- }
- else {
- slot.value = CANCELLED;
- throw ie;
- }
- }
- }
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/Takable.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/Takable.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/Takable.java
deleted file mode 100644
index 6d7f786..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/Takable.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: Takable.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 11Jun1998 dl Create public version
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * This interface exists to enable stricter type checking
- * for channels. A method argument or instance variable
- * in a consumer object can be declared as only a Takable
- * rather than a Channel, in which case a Java compiler
- * will disallow put operations.
- * <p>
- * Full method descriptions appear in the Channel interface.
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- * @see Channel
- * @see Puttable
-**/
-
-public interface Takable {
-
- /**
- * Return and remove an item from channel,
- * possibly waiting indefinitely until
- * such an item exists.
- * @return some item from the channel. Different implementations
- * may guarantee various properties (such as FIFO) about that item
- * @exception InterruptedException if the current thread has
- * been interrupted at a point at which interruption
- * is detected, in which case state of the channel is unchanged.
- *
- **/
- public Object take() throws InterruptedException;
-
-
- /**
- * Return and remove an item from channel only if one is available within
- * msecs milliseconds. The time bound is interpreted in a coarse
- * grained, best-effort fashion.
- * @param msecs the number of milliseconds to wait. If less than
- * or equal to zero, the operation does not perform any timed waits,
- * but might still require
- * access to a synchronization lock, which can impose unbounded
- * delay if there is a lot of contention for the channel.
- * @return some item, or null if the channel is empty.
- * @exception InterruptedException if the current thread has
- * been interrupted at a point at which interruption
- * is detected, in which case state of the channel is unchanged
- * (i.e., equivalent to a false return).
- **/
-
- public Object poll(long msecs) throws InterruptedException;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadFactory.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadFactory.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadFactory.java
deleted file mode 100644
index 7e51944..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: ThreadFactory.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 30Jun1998 dl Create public version
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * Interface describing any class that can generate
- * new Thread objects. Using ThreadFactories removes
- * hardwiring of calls to <code>new Thread</code>, enabling
- * applications to use special thread subclasses, default
- * prioritization settings, etc.
- * <p>
- * [<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>] <p>
- **/
-
-public interface ThreadFactory {
- /**
- * Create a new thread that will run the given command when started
- **/
- public Thread newThread(Runnable command);
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadFactoryUser.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadFactoryUser.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadFactoryUser.java
deleted file mode 100644
index 545110a..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadFactoryUser.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: ThreadFactoryUser.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 28aug1998 dl refactored from Executor classes
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- *
- * Base class for Executors and related classes that rely on thread factories.
- * Generally intended to be used as a mixin-style abstract class, but
- * can also be used stand-alone.
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-
-public class ThreadFactoryUser {
-
- protected ThreadFactory threadFactory_ = new DefaultThreadFactory();
-
- protected static class DefaultThreadFactory implements ThreadFactory {
- public Thread newThread(Runnable command) {
- return new Thread(command);
- }
- }
-
- /**
- * Set the factory for creating new threads.
- * By default, new threads are created without any special priority,
- * threadgroup, or status parameters.
- * You can use a different factory
- * to change the kind of Thread class used or its construction
- * parameters.
- * @param factory the factory to use
- * @return the previous factory
- **/
-
- public synchronized ThreadFactory setThreadFactory(ThreadFactory factory) {
- ThreadFactory old = threadFactory_;
- threadFactory_ = factory;
- return old;
- }
-
- /**
- * Get the factory for creating new threads.
- **/
- public synchronized ThreadFactory getThreadFactory() {
- return threadFactory_;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadedExecutor.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadedExecutor.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadedExecutor.java
deleted file mode 100644
index ece6aa1..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/ThreadedExecutor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- File: ThreadedExecutor.java
-
- Originally written by Doug Lea and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
- Thanks for the assistance and support of Sun Microsystems Labs,
- and everyone contributing, testing, and using this code.
-
- History:
- Date Who What
- 21Jun1998 dl Create public version
- 28aug1998 dl factored out ThreadFactoryUser
-*/
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- *
- * An implementation of Executor that creates a new
- * Thread that invokes the run method of the supplied command.
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
- **/
-public class ThreadedExecutor extends ThreadFactoryUser implements Executor {
-
- /**
- * Execute the given command in a new thread.
- **/
- public synchronized void execute(Runnable command) throws InterruptedException {
- if (Thread.interrupted())
- throw new InterruptedException();
-
- Thread thread = getThreadFactory().newThread(command);
- thread.start();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/TimedCallable.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/TimedCallable.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/TimedCallable.java
deleted file mode 100644
index 76bb2cc..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/TimedCallable.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/** Notice of modification as required by the LGPL
- * This file was modified by Gemstone Systems Inc. on
- * $Date$
- **/
-/*
- TimedCallable.java
-
- Originally written by Joseph Bowbeer and released into the public domain.
- This may be used for any purposes whatsoever without acknowledgment.
-
- Originally part of jozart.swingutils.
- Adapted by Doug Lea for util.concurrent.
-
- History:
- Date Who What
- 11dec1999 dl Adapted for util.concurrent
-
- */
-
-package com.gemstone.org.jgroups.oswego.concurrent;
-
-/**
- * TimedCallable runs a Callable function for a given length of time.
- * The function is run in its own thread. If the function completes
- * in time, its result is returned; otherwise the thread is interrupted
- * and an InterruptedException is thrown.
- * <p>
- * Note: TimedCallable will always return within the given time limit
- * (modulo timer inaccuracies), but whether or not the worker thread
- * stops in a timely fashion depends on the interrupt handling in the
- * Callable function's implementation.
- *
- * @author Joseph Bowbeer
- * @version 1.0
- *
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
-
- */
-
-public class TimedCallable extends ThreadFactoryUser implements Callable {
-
- private final Callable function;
- private final long millis;
-
- public TimedCallable(Callable function, long millis) {
- this.function = function;
- this.millis = millis;
- }
-
- public Object call() throws Exception {
-
- FutureResult result = new FutureResult();
-
- Thread thread = getThreadFactory().newThread(result.setter(function));
-
- thread.start();
-
- try {
- return result.timedGet(millis);
- }
- catch (InterruptedException ex) {
- /* Stop thread if we were interrupted or timed-out
- while waiting for the result. */
- thread.interrupt();
- throw ex;
- }
- }
-}