Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66F2818559 for ; Fri, 21 Aug 2015 21:23:17 +0000 (UTC) Received: (qmail 14643 invoked by uid 500); 21 Aug 2015 21:23:17 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 14609 invoked by uid 500); 21 Aug 2015 21:23:17 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 14600 invoked by uid 99); 21 Aug 2015 21:23:17 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2015 21:23:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A783318237C for ; Fri, 21 Aug 2015 21:23:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.795 X-Spam-Level: X-Spam-Status: No, score=0.795 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.006, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 7hMXL81Hbv3V for ; Fri, 21 Aug 2015 21:22:42 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id BD3D025D03 for ; Fri, 21 Aug 2015 21:22:28 +0000 (UTC) Received: (qmail 9387 invoked by uid 99); 21 Aug 2015 21:22:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2015 21:22:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A855DE715C; Fri, 21 Aug 2015 21:22:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: bschuchardt@apache.org To: commits@geode.incubator.apache.org Date: Fri, 21 Aug 2015 21:22:57 -0000 Message-Id: <89ca4229522948b7872111246a07993d@git.apache.org> In-Reply-To: <2436fee0ae564f7ea484456c1907c152@git.apache.org> References: <2436fee0ae564f7ea484456c1907c152@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [33/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/WaiterPreferenceSemaphore.java ---------------------------------------------------------------------- diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/WaiterPreferenceSemaphore.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/WaiterPreferenceSemaphore.java deleted file mode 100644 index 8a0b248..0000000 --- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/WaiterPreferenceSemaphore.java +++ /dev/null @@ -1,155 +0,0 @@ -/** Notice of modification as required by the LGPL - * This file was modified by Gemstone Systems Inc. on - * $Date$ - **/ -/* - File: WaiterPreferenceSemaphore.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 - 5Aug1998 dl replaced int counters with longs -*/ - - -package com.gemstone.org.jgroups.oswego.concurrent; - -/** - * An implementation of counting Semaphores that - * enforces enough fairness for applications that - * need to avoid indefinite overtaking without - * necessarily requiring FIFO ordered access. - * Empirically, very little is paid for this property - * unless there is a lot of contention among threads - * or very unfair JVM scheduling. - * The acquire method waits even if there are permits - * available but have not yet been claimed by threads that have - * been notified but not yet resumed. This makes the semaphore - * almost as fair as the underlying Java primitives allow. - * So, if synch lock entry and notify are both fair - * so is the semaphore -- almost: Rewaits stemming - * from timeouts in attempt, along with potentials for - * interrupted threads to be notified can compromise fairness, - * possibly allowing later-arriving threads to pass before - * later arriving ones. However, in no case can a newly - * entering thread obtain a permit if there are still others waiting. - * Also, signalling order need not coincide with - * resumption order. Later-arriving threads might get permits - * and continue before other resumable threads are actually resumed. - * However, all of these potential fairness breaches are - * very rare in practice unless the underlying JVM - * performs strictly LIFO notifications (which has, sadly enough, - * been known to occur) in which case you need to use - * a FIFOSemaphore to maintain a reasonable approximation - * of fairness. - *

[ Introduction to this package. ] -**/ - - -public final class WaiterPreferenceSemaphore extends Semaphore { - - /** - * Create a Semaphore with the given initial number of permits. - **/ - - public WaiterPreferenceSemaphore(long initial) { super(initial); } - - /** Number of waiting threads **/ - protected long waits_ = 0; - - @Override // GemStoneAddition - public void acquire() throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - synchronized(this) { - /* - Only take if there are more permits than threads waiting - for permits. This prevents infinite overtaking. - */ - if (permits_ > waits_) { - --permits_; - return; - } - else { - ++waits_; - try { - for (;;) { - wait(); - if (permits_ > 0) { - --waits_; - --permits_; - return; - } - } - } - catch(InterruptedException ex) { - --waits_; - notify(); - throw ex; - } - } - } - } - - @Override // GemStoneAddition - public boolean attempt(long msecs) throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - - synchronized(this) { - if (permits_ > waits_) { - --permits_; - return true; - } - else if (msecs <= 0) - return false; - else { - ++waits_; - - long startTime = System.currentTimeMillis(); - long waitTime = msecs; - - try { - for (;;) { - wait(waitTime); - if (permits_ > 0) { - --waits_; - --permits_; - return true; - } - else { // got a time-out or false-alarm notify - waitTime = msecs - (System.currentTimeMillis() - startTime); - if (waitTime <= 0) { - --waits_; - return false; - } - } - } - } - catch(InterruptedException ex) { - --waits_; - notify(); - throw ex; - } - } - } - } - - @Override // GemStoneAddition - public synchronized void release() { - ++permits_; - notify(); - } - - /** Release N permits **/ - @Override // GemStoneAddition - public synchronized void release(long n) { - permits_ += n; - for (long i = 0; i < n; ++i) notify(); - } - -} - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/WriterPreferenceReadWriteLock.java ---------------------------------------------------------------------- diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/WriterPreferenceReadWriteLock.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/WriterPreferenceReadWriteLock.java deleted file mode 100644 index 9e9e4f6..0000000 --- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/WriterPreferenceReadWriteLock.java +++ /dev/null @@ -1,337 +0,0 @@ -/** Notice of modification as required by the LGPL - * This file was modified by Gemstone Systems Inc. on - * $Date$ - **/ -/* - File: WriterPreferenceReadWriteLock.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 - 5Aug1998 dl replaced int counters with longs - 25aug1998 dl record writer thread - 3May1999 dl add notifications on interrupt/timeout - -*/ - -package com.gemstone.org.jgroups.oswego.concurrent; - -/** - * A ReadWriteLock that prefers waiting writers over - * waiting readers when there is contention. This class - * is adapted from the versions described in CPJ, improving - * on the ones there a bit by segregating reader and writer - * wait queues, which is typically more efficient. - *

- * The locks are NOT reentrant. In particular, - * even though it may appear to usually work OK, - * a thread holding a read lock should not attempt to - * re-acquire it. Doing so risks lockouts when there are - * also waiting writers. - *

[ Introduction to this package. ] - **/ - -public class WriterPreferenceReadWriteLock implements ReadWriteLock { - - protected long activeReaders_ = 0; - protected Thread activeWriter_ = null; - protected long waitingReaders_ = 0; - protected long waitingWriters_ = 0; - - protected final ReaderLock readerLock_ = new ReaderLock(); - protected final WriterLock writerLock_ = new WriterLock(); - - public Sync writeLock() { return writerLock_; } - public Sync readLock() { return readerLock_; } - - /* - A bunch of small synchronized methods are needed - to allow communication from the Lock objects - back to this object, that serves as controller - */ - - - protected synchronized void cancelledWaitingReader() { --waitingReaders_; } - protected synchronized void cancelledWaitingWriter() { --waitingWriters_; } - - - /** Override this method to change to reader preference **/ - protected boolean allowReader() { - return activeWriter_ == null && waitingWriters_ == 0; - } - - - protected synchronized boolean startRead() { - boolean allowRead = allowReader(); - if (allowRead) ++activeReaders_; - return allowRead; - } - - protected synchronized boolean startWrite() { - - // The allowWrite expression cannot be modified without - // also changing startWrite, so is hard-wired - - boolean allowWrite = (activeWriter_ == null && activeReaders_ == 0); - if (allowWrite) activeWriter_ = Thread.currentThread(); - return allowWrite; - } - - - /* - Each of these variants is needed to maintain atomicity - of wait counts during wait loops. They could be - made faster by manually inlining each other. We hope that - compilers do this for us though. - */ - - protected synchronized boolean startReadFromNewReader() { - boolean pass = startRead(); - if (!pass) ++waitingReaders_; - return pass; - } - - protected synchronized boolean startWriteFromNewWriter() { - boolean pass = startWrite(); - if (!pass) ++waitingWriters_; - return pass; - } - - protected synchronized boolean startReadFromWaitingReader() { - boolean pass = startRead(); - if (pass) --waitingReaders_; - return pass; - } - - protected synchronized boolean startWriteFromWaitingWriter() { - boolean pass = startWrite(); - if (pass) --waitingWriters_; - return pass; - } - - /** - * Called upon termination of a read. - * Returns the object to signal to wake up a waiter, or null if no such - **/ - protected synchronized Signaller endRead() { - if (--activeReaders_ == 0 && waitingWriters_ > 0) - return writerLock_; - else - return null; - } - - - /** - * Called upon termination of a write. - * Returns the object to signal to wake up a waiter, or null if no such - **/ - protected synchronized Signaller endWrite() { - activeWriter_ = null; - if (waitingReaders_ > 0 && allowReader()) - return readerLock_; - else if (waitingWriters_ > 0) - return writerLock_; - else - return null; - } - - - /** - * Reader and Writer requests are maintained in two different - * wait sets, by two different objects. These objects do not - * know whether the wait sets need notification since they - * don't know preference rules. So, each supports a - * method that can be selected by main controlling object - * to perform the notifications. This base class simplifies mechanics. - **/ - - protected abstract class Signaller { // base for ReaderLock and WriterLock - abstract public void signalWaiters(); // GemStoneAddition "public" - } - - protected class ReaderLock extends Signaller implements Sync { - - public void acquire() throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - InterruptedException ie = null; - synchronized(this) { - if (!startReadFromNewReader()) { - for (;;) { - boolean interrupted = Thread.interrupted(); // GemStoneAddition - try { - ReaderLock.this.wait(); - if (startReadFromWaitingReader()) - return; - } - catch(InterruptedException ex){ - interrupted = true; - cancelledWaitingReader(); - ie = ex; - break; - } - finally { // GemStoneAddition - if (interrupted) Thread.currentThread().interrupt(); - } - } - } - } - if (ie != null) { - // fall through outside synch on interrupt. - // This notification is not really needed here, - // but may be in plausible subclasses - writerLock_.signalWaiters(); - throw ie; - } - } - - - public void release() { - Signaller s = endRead(); - if (s != null) s.signalWaiters(); - } - - - @Override // GemStoneAddition; also added "public" - synchronized public void signalWaiters() { ReaderLock.this.notifyAll(); } - - public boolean attempt(long msecs) throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - InterruptedException ie = null; - synchronized(this) { - if (msecs <= 0) - return startRead(); - else if (startReadFromNewReader()) - return true; - else { - long waitTime = msecs; - long start = System.currentTimeMillis(); - for (;;) { - boolean interrupted = Thread.interrupted(); // GemStoneAddition - try { ReaderLock.this.wait(waitTime); } - catch(InterruptedException ex){ - interrupted = true; - cancelledWaitingReader(); - ie = ex; - break; - } - finally { - if (interrupted) Thread.currentThread().interrupt(); - } - if (startReadFromWaitingReader()) - return true; - else { - waitTime = msecs - (System.currentTimeMillis() - start); - if (waitTime <= 0) { - cancelledWaitingReader(); - break; - } - } - } - } - } - // safeguard on interrupt or timeout: - writerLock_.signalWaiters(); - if (ie != null) throw ie; - else return false; // timed out - } - - } - - protected class WriterLock extends Signaller implements Sync { - - public void acquire() throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - InterruptedException ie = null; - synchronized(this) { - if (!startWriteFromNewWriter()) { - for (;;) { - boolean interrupted = Thread.interrupted(); // GemStoneAddition - try { - WriterLock.this.wait(); - if (startWriteFromWaitingWriter()) - return; - } - catch(InterruptedException ex){ - interrupted = true; - cancelledWaitingWriter(); - WriterLock.this.notify(); - ie = ex; - break; - } - finally { - if (interrupted) Thread.currentThread().interrupt(); - } - } - } - } - if (ie != null) { - // Fall through outside synch on interrupt. - // On exception, we may need to signal readers. - // It is not worth checking here whether it is strictly necessary. - readerLock_.signalWaiters(); - throw ie; - } - } - - public void release(){ - Signaller s = endWrite(); - if (s != null) s.signalWaiters(); - } - - @Override // GemStoneAddition; also added "public" - synchronized public void signalWaiters() { WriterLock.this.notify(); } - - public boolean attempt(long msecs) throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - InterruptedException ie = null; - synchronized(this) { - if (msecs <= 0) - return startWrite(); - else if (startWriteFromNewWriter()) - return true; - else { - long waitTime = msecs; - long start = System.currentTimeMillis(); - for (;;) { - boolean interrupted = Thread.interrupted(); // GemStoneAddition - try { WriterLock.this.wait(waitTime); } - catch(InterruptedException ex){ - interrupted = true; - cancelledWaitingWriter(); - WriterLock.this.notify(); - ie = ex; - break; - } - finally { - if (interrupted) Thread.currentThread().interrupt(); - } - if (startWriteFromWaitingWriter()) - return true; - else { - waitTime = msecs - (System.currentTimeMillis() - start); - if (waitTime <= 0) { - cancelledWaitingWriter(); - WriterLock.this.notify(); - break; - } - } - } - } - } - - readerLock_.signalWaiters(); - if (ie != null) throw ie; - else return false; // timed out - } - - } - - - -} - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/package.html ---------------------------------------------------------------------- diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/package.html b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/package.html deleted file mode 100644 index 4bc83d8..0000000 --- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/oswego/concurrent/package.html +++ /dev/null @@ -1,998 +0,0 @@ - - - - Overview of package util.concurrent Release 1.3.4. - - - -

Overview of package util.concurrent Release 1.3.4.

- - by Doug Lea -

- -Note: Upon release of J2SE 1.5, this package enters maintenance mode: -Only essential corrections will be released. JDK1.5 package -java.util.concurrent includes improved, more efficient, -standardized versions of the main components in this package. Please -plan to convert your applications to use them. (A few niche classes -here have no equivalents in java.util.concurrent. They will become -part of a follow-up add-on package that will also include other -unstandardized classes.) - - -

- This package provides standardized, efficient versions of utility - classes commonly encountered in concurrent Java programming. This - code consists of implementations of ideas that have been around for - ages, and is merely intended to save you the trouble of coding them. - Discussions of the rationale and applications of several of these - classes can be found in the second edition of Concurrent Programming in - Java. There are also pdf - slides providing an overview of the package. - - -

- The package mainly consists of implementations of a few interfaces: -
-

    -
  • Sync -- locks, conditions
    -
  • Channel -- queues, buffers
    -
  • Barrier -- multi-party synchronization
    - -
  • SynchronizedVariable -- atomic ints, refs etc
    - -
  • java.util.Collection -- collections
    - -
  • Executor -- replacements for direct use of Thread
    -
- - Plus some utilities and frameworks that build upon these. -

- If you arrived at page
- http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html -
- following links from your local documentation, please check the - version number and get an update if you are running an outdated - version. - - -

Installation

- - This package, currently declared as -
- EDU.oswego.cs.dl.util.concurrent -
- - is available in (tar.gz -format) or (zip -format). - -

- - It is currently distributed in source form only. To build it, use a - Java 1.2+ compiler to: -

  javac -d [SOMEWHERE IN YOUR CLASSPATH] *.java
-
- Or use this ant build file donated by - Travell Perkins. -

- The classes in the misc directory can be built the - same way. -

- To use it, add to java files: -

  import EDU.oswego.cs.dl.util.concurrent.*
-
-

You can also create a jar or zip file of the compiled classes - and add them to your classpath. -

- All documentation - except for this file was produced by javadoc, which - places some index and summary files outside the current - directory. This can cause some broken links on unpacked versions. - You can avoid this, and integrate with your local javadoc-produced - documentation by running: -

  javadoc -public -d [BASE OF SOME JAVADOC PATH] *.java
-
- -

Contents

- -
Sync - -
Interface for classes used as exclusion, resource management, - and related synchronization aids, supporting methods - acquire, attempt(msecs), and - release. -

- Implementations - -

Semaphore -
Default implementation of Semaphores, providing no - special ordering guarantees. - -
WaiterPreferenceSemaphore -
Provides protection against barging (infinite overtaking) -
FIFOSemaphore -
Provides first-in/first-out ordering -
PrioritySemaphore -
Prefers notifications to higher-priority threads - -
Mutex -
Basic non-reentrant mutual exclusion lock -
ReentrantLock -
Java-style per-thread mutual exclusion lock -
Latch -
A condition that is acquirable forever more after the first release -
CountDown -
A condition that is acquirable forever more after the nth - release. -

- - The following implementation classes do not themselves perform any - synchronization, but serve as adaptors, glue, and extensibility - hooks for those that do. They may also be helpful when using Syncs - in generic before/after constructions: - -

NullSync -
A no-op implementation: acquire and attempt always succeed. -
TimeoutSync -
Routes all calls to acquire to use attempt with a predefined - timeout value. -
LayeredSync -
Cascades operations of two Syncs -
ObservableSync -
Issues calls to SyncObservers upon each acquire and release. -

- Related Classes -

CondVar -
Support for POSIX (pthreads) style condition variables -
TimeoutException -
A standardized time-out exception class -

- - -

ReadWriteLock -
Interface for pairs of locks, one for reading, and one for - writing. - -

- Implementations -

WriterPreferenceReadWriteLock -
The most useful and common policy - -
ReentrantWriterPreferenceReadWriteLock -
Allows multiple lock holds as well as lock downgrading by writers. - -
ReaderPreferenceReadWriteLock -
Prefers waiting readers to waiting writers. - -
FIFOReadWriteLock -
Prefers earliest threads (whether readers or writers). -

- -

Barrier -
Synchronization points for groups of threads. -

- Implementations -

CyclicBarrier -
A tool to force multiple threads to synchronize at a given point -
Rendezvous -
A cyclic barrier that does not rely on there being a - predetermined number of participant threads, and allows threads - to exchange information at each barrier point. -

- Related Classes -

BrokenBarrierException -
A standardized exception for barrier synchronization failures -

- -

Channel - -
Interface for queues, buffers, conduits and pipes supporting - blocking put and take, as well as - timeout-based offer and poll. To assist - efforts to use channels with somewhat greater type safety, Channel - is defined as a subinterface of Puttable and Takable, each defining only one side of - the channel. Also, the BoundedChannel subinterface is used - for channels with finite capacities. -

- Implementations - -

LinkedQueue -
An unbounded linked-list-based queue. This is usually the - best choice for a general-purpose queue. -
BoundedLinkedQueue -
A linked queue with a capacity bound -
BoundedBuffer -
An array-based bounded buffer -
Slot -
A one-slot bounded buffer. (Note that this can also - serve as a restricted form of Synchronized variable.) -
SynchronousChannel -
A zero-slot CSP/Ada-style channel in which every put must - wait for a take, and vice versa. -
BoundedPriorityQueue -
A channel based on a Heap data structure. Elements - must either be Comparable, or comparable using a supplied Comparator -
WaitFreeQueue -
An unbounded linked-list-based queue relying on atomic - commits and retries rather than wait/notify. - -

- Related Classes -

DefaultChannelCapacity -
A utility class that makes it easier to set default - capacities for channels that have a capacity that must otherwise - be set in constructors. -

- -

Executor -
Interface for objects that execute Runnable commands. - -

- Implementations -

DirectExecutor -
An implementation that just directly runs command - in current thread. - -
LockedExecutor -
An implementation that directly runs command - within a supplied Sync lock in current thread. - -
ThreadedExecutor -
An implementation that runs each command - in a new thread. - -
QueuedExecutor -
An implementation that queues commands for execution - by a single background thread. - -
PooledExecutor -
A tunable, extensible thread pool class -

- Related classes -

Callable -
Interface for runnable actions that return results -
FutureResult -
Holder for results of actions that can be set by Callables. -
ThreadFactory -
Interface for objects that create Thread objects -
ThreadFactoryUser -
Convenient base for classes that use ThreadFactories. -
ClockDaemon -
A utility for executing commands at given times, - after given delays, or periodically with given cycles. -
TimedCallable -
Invokes a Callable in its own thread, but cancels it if not - completed by a given maximum time. -

- -

Fork/Join Tasks - -
A fast lightweight task framework built upon Java threads, and - geared for parallel computation. - -
FJTask -
Abstract Base class for tasks. -
FJTaskRunnerGroup -
Control class for running Tasks. -
FJTaskRunner -
Underlying specialized Thread subclass for running Tasks. -
Demos and examples -
A directory of sample programs that use the Task framework. - (See also a paper on the design and - performance of this framework.) - -

- - -

Collections -
Implementations of java.util.Collection and related classes that - can help solve concurrency problems. -
ConcurrentReaderHashMap -
An analog of java.util.Hashtable that allows retrievals - during updates. - -
ConcurrentHashMap -
An analog of java.util.Hashtable that allows - both concurrent retrievals and concurrent updates. - -
CopyOnWriteArrayList -
A copy-on-write analog of java.util.ArrayList -
CopyOnWriteArraySet -
A java.util.Set based on CopyOnWriteArrayList. -
SyncCollection -
A wrapper class placing either Syncs or ReadWriteLocks - around java.util.Collection -
SyncSet -
A wrapper around java.util.Set -
SyncSortedSet -
A wrapper around java.util.SortedSet -
SyncList -
A wrapper around java.util.List -
SyncMap -
A wrapper around java.util.Map -
SyncSortedMap -
A wrapper around java.util.SortedMap -
Related classes -
-
PropertyChangeMulticaster -
A copy-on-write replacement for java.beans.PropertyChangeSupport -
VetoableChangeMulticaster -
A copy-on-write replacement for java.beans.VetoableChangeSupport - -

- -

SynchronizedVariable - -
Simple synchronized analogs of Number and Ref classes in - java.lang. Each has a subclass that in addition to maintaining - synchronization, also provides notifications upon value changes and - supports guarded waits. - -

- -

Miscellany - -
There are some classes in the misc directory - that might be of interest but aren't really part of this - package. They include: -
    -
  • SynchronizationTimer, - that can be used to experiment with different synchronization - schemes. It requires Swing (JFC). (To run it, compile misc/*.java, and - then java EDU.oswego.cs.dl.util.concurrent.misc.SynchronizationTimer .) -
  • An immutable Fraction class. -
  • Joe Bowbeer's - SwingWorker - class, discussed in his - "The Last Word in Swing Threads" article. -
  • Other implementations of the above interfaces that - are not valuable or stable enough to include here. -
- If you would like to contribute other related classes, demos, - usage examples, etc., please contact me. People frequently write - me asking for such things. -
- - - -

Notes

-
    - -
  • All classes are released to the public domain and may be used - for any purpose whatsoever without permission or - acknowledgment. Portions of the CopyOnWriteArrayList and - ConcurrentReaderHashMap classes are adapted from Sun JDK source - code. These are copyright of Sun Microsystems, Inc, and are used - with their kind permission, - as described in this license. - -

    - -

  • Version numbers for this package are of the form - Major.minor.fix. Fix numbers reflect corrections of small errors - and release problems (missing files, portability enhancements, - etc). Minor numbers are incremented on additions. Major numbers - reflect serious incompatibilities and restructurings. I may also - sometimes make minor updates to this page and related files before - packaging up all files as a release. During early releases of added - classes, I expect to make frequent small changes and releases, as - soon as problems are noticed. Other ongoing changes are reflected - in individual source files, that you can get individual updates on - if you need them. -

    - -

  • Most of the interfaces and classes contain usage notes and - examples. I hope to add more. Please send suggestions to dl@cs.oswego.edu -

    - -

  • You can get e-mail notification when this page (or any other - URL for that matter) changes via ChangeDetecion.com or - other such services. -

    - -

  • These have been tested with JDK1.2+, but all except those - relying on JDK1.2 java.util.collections (i.e., BoundedPriorityQueue - and CopyOnWriteArrayList) should also work with - JDK1.1.x. Workarounds exist for those relying on collections by - obtaining the backported - 1.1 versions and follow the instructions. - - You can then use "sed" or somesuch to replace all occurrences of - "java.util." with "com.sun.java.util". Also, I'm told that some - 1.1 compilers have some problems compiling some of the blank finals - used. And while the 1.1port of collections also includes a - 1.2-compliant version of java.util.Random, you can alternatively - use the following version contributed by Andrew Cooke: - -
    package EDU.oswego.cs.dl.util.concurrent ;
    -
    -class Random extends java.util.Random {
    -
    -� public Random() {super() ;}
    -� public Random(long l) {super(l) ;}
    -
    -� public int nextInt(int i) {
    -��� int ii = (int)(i * nextDouble()) ;
    -��� if (ii >= i) {ii = i-1 ;} // should (almost?) never happen...
    -��� return ii ;
    -� }
    -
    -}
    -
    -

    - - Konstantin L�ufer has generously placed a version compiled for JDK1.1 - at http://www.cs.luc.edu/~laufer/courses/337/handouts/concurrent11.zip -

    - -

  • Many of these classes are adapted from versions described in - the second edition of - Concurrent Programming in Java (CPJ) and examples from - tutorials based on the book. -

    - -

  • Several classes were developed with the help of David Holmes and Joe - Bowbeer. Many have benefited from discussions and comments from - other people, including Tom Cargill, Tom May, Wayne Boucher, - Matthias Ernst, Michael Banks, Richard Emberson, Piotr Kaminski, - Bill Pugh, Peter Buhr, Alexander Terekhov, Alex Yiu-Man Chan, - Andrew Kelly, Markos Kapes, Boris Dimitshteyn. - -
- -

Some Questions and Answers about Design and Implementation

- -
Isn't it annoying that so many methods throw InterruptedException? - -
Maybe, but synchronization points are among the best points to - detect interruption. Since this a package of synchronization aids, - most methods detect interruption as early and often as reasonable - to help avoid becoming stuck when the thread should be stopping - anyway. In particular, interruption is normally checked before - trying to obtain locks used in Syncs, which minimizes the - vulnerability window for getting stuck when an activity is - cancelled. (Between this and the finite durations that internal - java synchronization locks are held in Sync classes, it is normally - impossible for threads to become stuck waiting on internal locks - when they have been interrupted.) These classes fail cleanly upon - interruption. Normally, all you need to do upon catching an - InterruptedException is either rethrow it, or clean up and then set - Thread.currentThread().interrupt() to propagate - status. -

- - If you need to invoke such methods even when the thread is in an - interrupted state (for example, during recovery actions) you can do: -

  void quietlyAcquire(Sync sync) {
-    boolean wasInterrupted = Thread.interrupted(); // record and clear
-    for (;;) {
-      try {
-        sync.acquire();   // or any other method throwing InterruptedException
-        break;
-      }
-      catch (InterruptedException ex) { // re-interrupted; try again
-        wasInterrupted = true;
-      }
-    }
-    if (wasInterrupted) {              // re-establish interrupted state
-      Thread.currentThread().interrupt();
-    }
- }
-
-

- The heavy use of InterruptedException makes it possible to write - very responsive and robust code, at the expense of forcing class - and method authors to contemplate possible exception handling - actions at each interruption (and time-out) point. See the CPJ supplement - page on cancellation for more discussion of some associated - design issues. - -

- -

Why is there so much near-duplication of code? - -
You'd think there would be some nice way to unify more classes - to share significant aspects of synchronization mechanics. But - standard lines of attack for doing this turn out unsatisfying at - best. The main reason for creating this package is that even - simple classes involving concurrency control mechanics are - sometimes tedious, repetitive, tricky, and/or error-prone to write, - so it is nice to have them written already. -

- -

Why do most methods return false/null after timeouts rather - than throwing TimeoutException? - -
Because I think it would normally be misleading to throw - exceptions. In Java, timeout arguments merely provide hints about - when threads should be woken to check out the state of the world. - Due to scheduling delays, threads need not resume immediately after - their timeouts elapse, so real-time-based timeout exceptions would - not be appropriate. The simplest course of action is just to report - whether the condition the thread is waiting for does hold after - waiting for at least this period. Returning false/null is not - necessarily an exceptional situation. In those classes where it is - exceptional (in some classes layered on top of basic Syncs and - Channels) failed timeouts are converted to TimeoutExceptions. You - can do the same in your own code using these classes. As of version - 1.1.0, this is made simpler to carry out, since TimeoutException - now extends InterruptedException. -

- -

Why aren't there deadlock-detecting Syncs or related classes for - detecting lockups? - -
Because timeouts appear to be more generally useful. In fact, - it is hard to imagine contexts where deadlock detection is a better - option than timeouts in Java. A timeout can serve as a heuristic - deadlock detection device, but can also serve to detect stalled IO, - network partitions, and related failures. Program responses to - deadlock are hardly ever different than responses to these other - failures. So, it is usually a good idea to use timeouts as - general-purpose heuristic detectors for all liveness problems, - subdividing responses to particular failures (for example, by - subclassing TimeoutException), only when necessary. Additionally, - there are two problems with implementing deadlock-detecting Syncs - that make them unattractive choices: (1) They can only detect - deadlock among uses of the particular Sync classes being used, so - cannot deal with deadlocks involving builtin synchronization (2) - lock cycle detection adds overhead to each lock acquire and - release. The main context in which deadlock detection would be - useful is during program debugging, but here, it would be better to - rely on specially instrumented JVMs. (Note that it is easy to - transform code that relies on acquire to instead use timeouts via - the TimeoutSync class. This can be a good way to make code more - robust with respect to locking problems.) -

- -

Why isn't there a distinct Lock or MutualExclusionLock interface? - -
Because many objects implementing the Sync interface can be - used as locks if they are in appropriate states, but not all of - them can always be used as such. Additionally, there are several - senses of mutual exclusion (for example, reentrant vs - non-reentrant, full vs read/write). Since there is no way to say - that a given class only sometimes conforms to the intended sense of - a subinterface, the flexibility and simplicity of only using a - single principle interface (Sync) for all such types outweighs the - potential advantages of finer-grained categorizations. -

- -

Why do so many methods perform notify within InterruptedException - catches? - -
Because when notify's and interrupt's happen at about the - same time, JVMs are currently free to treat them independently, so - a notified thread could return out as interrupted. In classes - using notify rather than notifyAll, the extra notify in the catch - clause is a safeguard to ensure that a non-interrupted thread, if - one exists, will be notified. See my CPJ book for more details. -

- -

How efficient are these classes? - -
Most of these classes use the most efficient implementations I - know of for general-purpose concurrent programming, yet also try to - be conservative about differences across common JVMs, and to - minimize surprising limitations and side-effects. This is always a - bit of a trade-off though. Some could be made more efficient at the - cost of supporting fewer operations, relying on properties of - particular JVMs, or having more usage constraints. Conversely some - could support more contexts or operations, or simpler usage, at the - cost of efficiency. - -

- - You will almost surely trade off some cost in efficiency for the - flexibility of using Syncs and classes built out of them rather - than built-in synchronized method/block locks. On - some JVMs the cost is very low. (You can check approximate impact - using SynchronizationTimer.) - But, while Java VMs are getting much faster about - synchronized locks, most of the classes in this - package rely heavily on wait/notify and interruption mechanics, - which are not currently as heavily optimized. (Also, they seem to - be subject to more variation in behavior than other Java - constructs.) Class implementations generally ignore the fact - that the JVM overhead for these operations might be slower than - you'd wish they were on some JVMs. - -

- -

Are there any programming errors? - -
I don't believe so. Please try to prove me wrong. If you are - the first person to discover a particular coding error in a - current release, I'll send you a free copy of my CPJ book. Also, - I would greatly appreciate receiving any sample applications that - can help serve as useful tests, so as to build up a more extensive - test suite. -

- -

Should I worry about the use of volatile in these - classes? - -
Many JVMs are known not to correctly implement the JLS spec - (either the original or the upcoming revision) for volatile fields. - However, volatiles are used in conservative ways in this package, - that don't encounter problems at least on recent Sun and IBM JVMs. - -

- - -

Why do classes declare practically all internal matters as - protected? - -
While probably 99% of the uses of these classes should - just treat them as black-box utility components, these classes are - intended to be extensible, to allow more specialized - synchronization control to be customized for different - applications. However, it takes a lot of expertise to extend or - modify most of them via subclassing. If you do try to extend, - consider first running javadoc on these classes with switches that - generate documentation for non-public classes, methods, and - fields. Also, if you encounter problems making subclasses due to - inflexibility in base classes, I'd like to hear about it, so I can - try to come up with a better factoring. -

- -

Why aren't most classes Serializable? -
I don't know what to about this. On one hand, it wouldn't - make sense in a lot of contexts to serialize, say, a Semaphore. On - the other hand, maybe it ought not be precluded. Opinions - welcome. One suggestion is to only declare as serializable those - classes specifically designed to work with other persistent or - distributed concurrency control frameworks. (No such classes - currently exist.) -

- -

Why didn't using ReadWriteLocks instead of plain - synchronization speed up my program? -
ReadWriteLocks have more overhead than do synchronized - methods or blocks. They pay off only when the code being - protected by the locks is time-consuming, and when readers - outnumber writers, so the increased concurrency outweighs the - increased bookkeeping. (They are also sometimes of use in - avoiding deadlock.) Special-purpose data structures such as the - Concurrent hash tables in this package have far less overhead, and - typically much better performance than placing ReadWriteLocks - around most sequential data structures. -

- -

Are instances of these classes externally lockable -- that is, - can I control object x via synchronized(x) { - ... } ? -
Not necessarily. Some objects rely on their own - synchronization locks, some rely on internal locks, some rely on - other synchronization objects. So in general, you cannot know the - effect of synchronized(x) and so probably ought never - use it. -

- -

Why do I get strict alternation of producer and consumer - threads when using buffered channels such as BoundedBuffer? - -
Although it depends on details of JVM scheduling policies, - this is the most likely result when producer and consumer actions - both take about the same amount of time to process, since both put - and take operations signal waiting threads. The point of buffering - is to decouple producers and consumers when one or the other is - bursty, so temporarily gets ahead or behind its average rate. (If - the average rates of producers and consumers are not approximately - equal, buffering is not of much use.) While it again relies on JVM - details, unbounded buffers (for example LinkedQueue) typically do - not result in alternation, allowing producers to get arbitrarily - ahead of consumers, at the expense of potential resource - exhaustion. - -

- -

Why aren't there timeout methods supporting nanosecond - arguments? -
Because most JVMs only time to millisecond accuracy (at best) - anyway. If this changes, nanosecond versions could be added. -

- -

Why is the package named EDU..., not edu? -
I've been using the initially-recommended upper-case EDU prefix - for a long time for my packages. It would take a lot of busy-work - to convert everything to the now-recommended practice of using - lower-case. Someday I will do this though. - -

- - -

Why do you use those ugly underscores?! -
Because otherwise I tend to make coding mistakes surrounding - instance variables versus local variables. See my Sample - Java Coding Standard. But I think I've decided to reform :-) - Newer classes use a more JDK-like set of conventions. -

- -

Why don't you supply Ant build scripts? Or Jar files? Or - rearrange into separate src/doc/lib directories? Or CVS? Or ...? -
There are too many different ways people would like to use - this package for me to keep up with. So I release it in a simple - way that should be very easy to adapt to all sorts of different - needs and conventions. -

- -

Is this code in any way tied to Sun JDK releases? - -
No. The acknowlegdment to Sun Labs in headers recognizes - their generous donations of equipment and release time support that - help make this work possible. But this software is not in any way - tied to Sun. However, work is underway to create a JSR with the - goal of including a similar package in a future JDK release. - -

- -

Can I use this code in commercial products? -
Yes. Many people appear to do so. -

- -

Do I need a license to use it? Can I get one? -
No! -

- -

Can I get commercial support for this package? -
I don't know of any place to get it. I can't think of any - technical reason that you'd want it. -

- -

- - -

Sources

- - - -

History

- -
    -
  • 10Jul1998 1.0 -
  • 11Jul1998 1.0.1: removed .class files from release, Fixed - documentation error, included Barrier interface. -
  • 12Jul1998 1.0.2: Fixed return value for swap; fixed documentation errors. -
  • 15Jul1998 1.0.3: Fixed more documentation errors; re-fixed swap; - other cosmetic improvements. -
  • 18Jul1998 1.0.4: Simplified some classes by removing - some alleged optimizations that do not actually help on some platforms; - improved SynchronizationTimer; added some documentation. -
  • 1Sep1998 version 1.1.0: -
      -
    • Replace SynchronousChannel algorithm with fairer, more scalable one -
    • TimeoutException now extends InterruptedException -
    • Replace int counters with longs to avoid wrapping. -
    • new LayeredSync class -
    • new ObservableSync class -
    • new NullSync class -
    • new TimeoutSync class -
    • new SyncCollection classes -
    • new ReentrantWriterPreferenceReadWriteLock class -
    • peek added to Channel -
    • new ClockDaemon class -
    • Refactorings to standardize usage of thread factories -
    • removed reliance on ThreadGroups in PooledExecutor -
    -
  • 7Jan 1999 Version 1.2 -
      -
    • ClockDaemon.shutdown allows immediate restart -
    • Callable.call throws Throwable, not Exception -
    • new Task, TaskRunner, TaskRunnerGroup classes -
    • new taskDemo subdirectory -
    -
  • 13Jan1999 version 1.2.1 -
      -
    • Minor cleanup of Task classes -
    - -
  • 17Jan1999 version 1.2.2: -
      -
    • Simplify Task classes; improve documentation; - add priority control; they are no longer labeled as `preliminary'. -
    • More sample programs in taskDemos -
    • Add warnings about reentrancy to RW locks -
    • Callable throws Exception again, but FutureResult handles Throwables -
    - -
  • 25Mar1999 version 1.2.3 -
      -
    • PooledExecutor -- allow pool to shrink when max size decreased -
    • Task -- add reset, array-based operations -
    • new PropertyChangeMulticaster, VetoableChangeMulticaster -
    - -
  • 21may1999 version 1.2.4 -
      -
    • PooledExecutor -- allow supplied Channel in constructor; - new methods createThreads(), drain() -
    • Task, TaskRunner, TaskRunnerGroup renamed to - FJTask, FJTaskRunner, FJTaskRunnerGroup to avoid - clashes with commonly used class name of `Task'. -
    • Misc documentation improvements -
    • WriterPreferenceReadWriteLock -- fix to notify on interrupt -
    - -
  • 23oct1999 version 1.2.5 -
      -
    • PooledExecutor -- add minimumPoolSize settings -
    • LU in taskDemo -
    • Minor improvements to LinkedQueue, FJTaskRunner -
    - - -
  • 29dec1999 version 1.2.6 -
      -
    • FJTaskRunner -- now works on MP JVMs that do not - correctly implement read-after-write of volatiles. -
    • added TimedCallable -
    - - -
  • 12jan2001 version 1.3.0 -
      -
    • new ConcurrentHashMap, ConcurrentReaderHashMap classes. -
    • BoundedLinkedQueue.setCapacity: immediately reconcile permits. -
    • ReentrantWriterPreferenceReadWriteLock: Both readers and writers - are now reentrant. -
    • PooledExecutor: policy now an interface, not abstract class. -
    • QueuedExecutor, PooledExecutor: new shutdown methods -
    - -
  • 2dec2001 Version 1.3.1 -
      -
    • PooledExecutor: declare inner class constructor as protected, - more flexible shutdown support, blocked exec handlers can - throw InterruptedExceptions. -
    • Ensure all serialization methods are private. -
    • Joe Bowbeer's SwingWorker now in misc -
    • Improvements to ConcurrentHashMap, ConcurrentReaderHashMap, - FIFOReadWriteLock, ReentrantWriterPreferenceReadWriteLock. - WaitFreeQueue, SynchronousChannel. -
    - -
  • 12dec2002 Version 1.3.2 -
      -
    • SemaphoreControlledChannel - fix constructor to - use longs, not ints. -
    • Improvements to Heap. -
    • Fix interference check in ConcurrentReaderHashMap. -
    • ReentrantWriterPreferenceReadWriteLock throw IllegalStateException - instead of NullPointerException on release errors. -
    -
  • 20feb2004 Version 1.3.3 -
      -
    • PooledExecutor: Create new threads if needed when terminating. - (Thanks to Bruno Dumon), and replace dying thread if it is only one. -
    • Clarify by-permission wordings. -
    • Fix synchronization scope error in SynchronizedLong (Thanks to - Aaron Greenhouse.) -
    -
  • 20may2004 Version 1.3.4 -
      -
    • WaitableX: notify on bitwise operations -
    • QueuedExecutor: can shutdown before thread created (thanks to - Wolfgang Hoschek) -
    -
  • Coming attractions -
      -
    • This package is entering maintenance mode because improved - versions of main functionality are part of JDK1.5 java.util.concurrent - via - JSR 166. -
    • -
    -
- - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/overview.html ---------------------------------------------------------------------- diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/overview.html b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/overview.html deleted file mode 100644 index 0172ca8..0000000 --- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/overview.html +++ /dev/null @@ -1,15 +0,0 @@ - - - -JGroups is a toolkit for reliable group communication. Processes -can join a group, send messages to all members or single members, and -receive messages from members in the group. The system keeps track of -the members in every group, and notifies group members when a new -member joins, or an existing member leaves or crashes. A group is -identified by its name. Groups do not have to be created explicitly; -when a process joins a non-existing group, that group will be created -automatically. Member processes of a group can be located on the same -host, within the same LAN, or across a WAN. A member can be part of -multiple groups. - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/package.html ---------------------------------------------------------------------- diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/package.html b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/package.html deleted file mode 100644 index e393a0f..0000000 --- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/package.html +++ /dev/null @@ -1,5 +0,0 @@ - - - Provides top-level public JGroups classes such as Channel, Message, etc. - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotConnectException.java ---------------------------------------------------------------------- diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotConnectException.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotConnectException.java deleted file mode 100644 index 6cc78b2..0000000 --- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotConnectException.java +++ /dev/null @@ -1,55 +0,0 @@ -/** Notice of modification as required by the LGPL - * This file was modified by Gemstone Systems Inc. on - * $Date$ - **/ -package com.gemstone.org.jgroups.persistence; - -/** - * @author Mandar Shinde - * This exception inherits the Exception class and is used in - * cases where the Persistence Storage cannot be connected to - * for any purpose. - */ - - -public class CannotConnectException extends Exception -{ - - private static final long serialVersionUID = -4938856570415903498L; - /** - * @param t - * @param reason implementor-specified runtime reason - */ - public CannotConnectException(Exception t, String reason) - { - this.t = t; - this.reason = reason; - } - - /** - * @param t - * @param reason implementor-specified runtime reason - */ - public CannotConnectException(Throwable t, String reason) - { - this.t = t; - this.reason = reason; - } - - /** - * @return String; - */ - @Override // GemStoneAddition - public String toString() - { - String tmp = "Exception " + t.toString() + " was thrown due to " + reason; - return tmp; - } - - /** - * members are made available so that the top level user can dump - * appropriate members on to his stack trace - */ - public Throwable t = null; - public String reason = null; -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotCreateSchemaException.java ---------------------------------------------------------------------- diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotCreateSchemaException.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotCreateSchemaException.java deleted file mode 100644 index 9d40558..0000000 --- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotCreateSchemaException.java +++ /dev/null @@ -1,45 +0,0 @@ -/** Notice of modification as required by the LGPL - * This file was modified by Gemstone Systems Inc. on - * $Date$ - **/ -package com.gemstone.org.jgroups.persistence; - -/** - * @author Mandar Shinde - * This exception inherits the Exception class and is used in - * cases where the Persistence Storage cannot create schema to - * use the API as required. At this point, top level use needs to - * decide whether to continue or abort. - */ - -public class CannotCreateSchemaException extends Exception -{ - private static final long serialVersionUID = 932964652498346597L; - - /** - * @param t - * @param reason implementor-specified runtime reason - */ - public CannotCreateSchemaException(Throwable t, String reason) - { - this.t = t; - this.reason = reason; - } - - /** - * @return String - */ - @Override // GemStoneAddition - public String toString() - { - String tmp = "Exception " + t.toString() + " was thrown due to " + reason; - return tmp; - } - - /** - * members are made available so that the top level user can dump - * appropriate members on to his stack trace - */ - private Throwable t = null; - private String reason = null; -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotPersistException.java ---------------------------------------------------------------------- diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotPersistException.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotPersistException.java deleted file mode 100644 index 35ccaf5..0000000 --- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotPersistException.java +++ /dev/null @@ -1,44 +0,0 @@ -/** Notice of modification as required by the LGPL - * This file was modified by Gemstone Systems Inc. on - * $Date$ - **/ -package com.gemstone.org.jgroups.persistence; - -/** - * @author Mandar Shinde - * This exception inherits the Exception class and is used in - * cases where the Persistence Storage cannot persist a pair - * from its storage mechanism (leading to fatal errors) - */ - -public class CannotPersistException extends Exception -{ - private static final long serialVersionUID = -5346794365646061026L; - - /** - * @param t - * @param reason implementor-specified runtime reason - */ - public CannotPersistException(Throwable t, String reason) - { - this.t = t; - this.reason = reason; - } - - /** - * @return String; - */ - @Override // GemStoneAddition - public String toString() - { - String tmp = "Exception " + t.toString() + " was thrown due to " + reason; - return tmp; - } - - /** - * members are made available so that the top level user can dump - * appropriate members on to his stack trace - */ - private Throwable t = null; - private String reason = null; -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotRemoveException.java ---------------------------------------------------------------------- diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotRemoveException.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotRemoveException.java deleted file mode 100644 index e6f6fa6..0000000 --- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotRemoveException.java +++ /dev/null @@ -1,45 +0,0 @@ -/** Notice of modification as required by the LGPL - * This file was modified by Gemstone Systems Inc. on - * $Date$ - **/ -package com.gemstone.org.jgroups.persistence; - -/** - * @author Mandar Shinde - * This exception inherits the Exception class and is used in - * cases where the Persistence Storage cannot remove a pair - * from its storage mechanism (leading to permannt errors) - */ - -public class CannotRemoveException extends Exception -{ - - private static final long serialVersionUID = -11649062965054429L; - - /** - * @param t - * @param reason implementor-specified runtime reason - */ - public CannotRemoveException(Throwable t, String reason) - { - this.t = t; - this.reason = reason; - } - - /** - * @return String; - */ - @Override // GemStoneAddition - public String toString() - { - String tmp = "Exception " + t.toString() + " was thrown due to " + reason; - return tmp; - } - - /** - * members are made available so that the top level user can dump - * appropriate members on to his stack trace - */ - public Throwable t = null; - public String reason = null; -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotRetrieveException.java ---------------------------------------------------------------------- diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotRetrieveException.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotRetrieveException.java deleted file mode 100644 index 4419fa1..0000000 --- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/CannotRetrieveException.java +++ /dev/null @@ -1,44 +0,0 @@ -/** Notice of modification as required by the LGPL - * This file was modified by Gemstone Systems Inc. on - * $Date$ - **/ -package com.gemstone.org.jgroups.persistence; - -/** - * @author Mandar Shinde - * This exception inherits the Exception class and is used in - * cases where the Persistence Storage cannot retrieve a pair - * from its storage mechanism (leading to failure of mechanism) - */ - -public class CannotRetrieveException extends Exception -{ - private static final long serialVersionUID = -3825072530525191050L; - - /** - * @param t - * @param reason implementor-specified runtime reason - */ - public CannotRetrieveException(Throwable t, String reason) - { - this.t = t; - this.reason = reason; - } - - /** - * @return String; - */ - @Override // GemStoneAddition - public String toString() - { - String tmp = "Exception " + t.toString() + " was thrown due to " + reason; - return tmp; - } - - /** - * members are made available so that the top level user can dump - * appropriate members on to his stack trace - */ - private Throwable t = null; - private String reason = null; -}