link start!
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
import com.tridium.util.backport.Deque;
|
||||
import java.util.Iterator;
|
||||
|
||||
public interface BlockingDeque extends BlockingQueue, Deque {
|
||||
boolean add(Object obj);
|
||||
|
||||
void addFirst(Object obj);
|
||||
|
||||
void addLast(Object obj);
|
||||
|
||||
boolean contains(Object obj);
|
||||
|
||||
Object element();
|
||||
|
||||
Iterator iterator();
|
||||
|
||||
boolean offer(Object obj);
|
||||
|
||||
boolean offer(Object obj, long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
boolean offerFirst(Object obj);
|
||||
|
||||
boolean offerFirst(Object obj, long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
boolean offerLast(Object obj);
|
||||
|
||||
boolean offerLast(Object obj, long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
Object peek();
|
||||
|
||||
Object poll();
|
||||
|
||||
Object poll(long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
Object pollFirst(long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
Object pollLast(long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
void push(Object obj);
|
||||
|
||||
void put(Object obj) throws InterruptedException;
|
||||
|
||||
void putFirst(Object obj) throws InterruptedException;
|
||||
|
||||
void putLast(Object obj) throws InterruptedException;
|
||||
|
||||
Object remove();
|
||||
|
||||
boolean remove(Object obj);
|
||||
|
||||
boolean removeFirstOccurrence(Object obj);
|
||||
|
||||
boolean removeLastOccurrence(Object obj);
|
||||
|
||||
int size();
|
||||
|
||||
Object take() throws InterruptedException;
|
||||
|
||||
Object takeFirst() throws InterruptedException;
|
||||
|
||||
Object takeLast() throws InterruptedException;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
import com.tridium.util.backport.Queue;
|
||||
import java.util.Collection;
|
||||
|
||||
public interface BlockingQueue extends Queue {
|
||||
boolean add(Object obj);
|
||||
|
||||
boolean contains(Object obj);
|
||||
|
||||
int drainTo(Collection collection);
|
||||
|
||||
int drainTo(Collection collection, int i);
|
||||
|
||||
boolean offer(Object obj);
|
||||
|
||||
boolean offer(Object obj, long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
Object poll(long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
void put(Object obj) throws InterruptedException;
|
||||
|
||||
int remainingCapacity();
|
||||
|
||||
boolean remove(Object obj);
|
||||
|
||||
Object take() throws InterruptedException;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
public interface Callable {
|
||||
Object call() throws Exception;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
public interface CompletionService {
|
||||
Future poll();
|
||||
|
||||
Future poll(long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
Future submit(Callable callable);
|
||||
|
||||
Future submit(Runnable runnable, Object obj);
|
||||
|
||||
Future take() throws InterruptedException;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface ConcurrentMap extends Map {
|
||||
Object putIfAbsent(Object obj, Object obj2);
|
||||
|
||||
boolean remove(Object obj, Object obj2);
|
||||
|
||||
Object replace(Object obj, Object obj2);
|
||||
|
||||
boolean replace(Object obj, Object obj2, Object obj3);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
import com.tridium.util.backport.NavigableMap;
|
||||
import com.tridium.util.backport.NavigableSet;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
|
||||
public interface ConcurrentNavigableMap extends ConcurrentMap, NavigableMap {
|
||||
NavigableSet descendingKeySet();
|
||||
|
||||
NavigableMap descendingMap();
|
||||
|
||||
NavigableMap headMap(Object obj, boolean z);
|
||||
|
||||
SortedMap headMap(Object obj);
|
||||
|
||||
Set keySet();
|
||||
|
||||
NavigableSet navigableKeySet();
|
||||
|
||||
NavigableMap subMap(Object obj, boolean z, Object obj2, boolean z2);
|
||||
|
||||
SortedMap subMap(Object obj, Object obj2);
|
||||
|
||||
NavigableMap tailMap(Object obj, boolean z);
|
||||
|
||||
SortedMap tailMap(Object obj);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
public interface Delayed extends Comparable {
|
||||
long getDelay(TimeUnit timeUnit);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
public interface Executor {
|
||||
void execute(Runnable runnable);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface ExecutorService extends Executor {
|
||||
boolean awaitTermination(long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
List invokeAll(Collection collection) throws InterruptedException;
|
||||
|
||||
List invokeAll(Collection collection, long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
Object invokeAny(Collection collection) throws InterruptedException, ExecutionException;
|
||||
|
||||
Object invokeAny(Collection collection, long j, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException;
|
||||
|
||||
boolean isShutdown();
|
||||
|
||||
boolean isTerminated();
|
||||
|
||||
void shutdown();
|
||||
|
||||
List shutdownNow();
|
||||
|
||||
Future submit(Callable callable);
|
||||
|
||||
Future submit(Runnable runnable);
|
||||
|
||||
Future submit(Runnable runnable, Object obj);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
public interface Future {
|
||||
boolean cancel(boolean z);
|
||||
|
||||
Object get() throws InterruptedException, ExecutionException;
|
||||
|
||||
Object get(long j, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException;
|
||||
|
||||
boolean isCancelled();
|
||||
|
||||
boolean isDone();
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
public interface RejectedExecutionHandler {
|
||||
void rejectedExecution(Runnable runnable, ThreadPoolExecutor threadPoolExecutor);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
public interface RunnableFuture extends Runnable, Future {
|
||||
void run();
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
public interface RunnableScheduledFuture extends RunnableFuture, ScheduledFuture {
|
||||
boolean isPeriodic();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
public interface ScheduledExecutorService extends ExecutorService {
|
||||
ScheduledFuture schedule(Callable callable, long j, TimeUnit timeUnit);
|
||||
|
||||
ScheduledFuture schedule(Runnable runnable, long j, TimeUnit timeUnit);
|
||||
|
||||
ScheduledFuture scheduleAtFixedRate(Runnable runnable, long j, long j2, TimeUnit timeUnit);
|
||||
|
||||
ScheduledFuture scheduleWithFixedDelay(Runnable runnable, long j, long j2, TimeUnit timeUnit);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
public interface ScheduledFuture extends Delayed, Future {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.tridium.util.backport.concurrent;
|
||||
|
||||
public interface ThreadFactory {
|
||||
Thread newThread(Runnable runnable);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.tridium.util.backport.concurrent.helpers;
|
||||
|
||||
public interface NanoTimer {
|
||||
long nanoTime();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.tridium.util.backport.concurrent.locks;
|
||||
|
||||
import com.tridium.util.backport.concurrent.TimeUnit;
|
||||
import java.util.Date;
|
||||
|
||||
public interface Condition {
|
||||
void await() throws InterruptedException;
|
||||
|
||||
boolean await(long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
void awaitUninterruptibly();
|
||||
|
||||
boolean awaitUntil(Date date) throws InterruptedException;
|
||||
|
||||
void signal();
|
||||
|
||||
void signalAll();
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.tridium.util.backport.concurrent.locks;
|
||||
|
||||
import com.tridium.util.backport.concurrent.TimeUnit;
|
||||
|
||||
public interface Lock {
|
||||
void lock();
|
||||
|
||||
void lockInterruptibly() throws InterruptedException;
|
||||
|
||||
Condition newCondition();
|
||||
|
||||
boolean tryLock();
|
||||
|
||||
boolean tryLock(long j, TimeUnit timeUnit) throws InterruptedException;
|
||||
|
||||
void unlock();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tridium.util.backport.concurrent.locks;
|
||||
|
||||
public interface ReadWriteLock {
|
||||
Lock readLock();
|
||||
|
||||
Lock writeLock();
|
||||
}
|
||||
Reference in New Issue
Block a user