public final class ArrayCompositeSubscription extends AtomicReferenceArray<org.reactivestreams.Subscription> implements Disposable
Note that since the implementation leaks the methods of AtomicReferenceArray, one must be careful to only call setResource, replaceResource and dispose on it. All other methods may lead to undefined behavior and should be used by internal means only.
Constructor and Description |
---|
ArrayCompositeSubscription(int capacity) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Dispose the resource, the operation should be idempotent.
|
boolean |
isDisposed()
Returns true if this resource has been disposed.
|
org.reactivestreams.Subscription |
replaceResource(int index,
org.reactivestreams.Subscription resource)
Replaces the resource at the specified index and returns the old resource.
|
boolean |
setResource(int index,
org.reactivestreams.Subscription resource)
Sets the resource at the specified index and disposes the old resource.
|
accumulateAndGet, compareAndSet, get, getAndAccumulate, getAndSet, getAndUpdate, lazySet, length, set, toString, updateAndGet, weakCompareAndSet
public boolean setResource(int index, org.reactivestreams.Subscription resource)
index
- the index of the resource to setresource
- the new resourcepublic org.reactivestreams.Subscription replaceResource(int index, org.reactivestreams.Subscription resource)
index
- the index of the resource to replaceresource
- the new resourcepublic void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()
Disposable
isDisposed
in interface Disposable
Copyright © 2018 JBoss by Red Hat. All rights reserved.