public final class SequentialDisposable extends AtomicReference<Disposable> implements Disposable
The class extends AtomicReference directly so watch out for the API leak!
Constructor and Description |
---|
SequentialDisposable()
Constructs an empty SequentialDisposable.
|
SequentialDisposable(Disposable initial)
Construct a SequentialDisposable with the initial Disposable provided.
|
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.
|
boolean |
replace(Disposable next)
Atomically: set the next disposable on this container but don't dispose the previous
one (if any) or dispose next if the container has been disposed.
|
boolean |
update(Disposable next)
Atomically: set the next disposable on this container and dispose the previous
one (if any) or dispose next if the container has been disposed.
|
accumulateAndGet, compareAndSet, get, getAndAccumulate, getAndSet, getAndUpdate, lazySet, set, toString, updateAndGet, weakCompareAndSet
public SequentialDisposable()
public SequentialDisposable(Disposable initial)
initial
- the initial disposable, null allowedpublic boolean update(Disposable next)
next
- the Disposable to set, may be nullreplace(Disposable)
public boolean replace(Disposable next)
next
- the Disposable to set, may be nullupdate(Disposable)
public void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()
Disposable
isDisposed
in interface Disposable
Copyright © 2018 JBoss by Red Hat. All rights reserved.