public abstract class AbstractAsyncPrimitive<A extends AsyncPrimitive,S> extends Object implements AsyncPrimitive
DEFAULT_OPERATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
void |
addStateChangeListener(Consumer<PrimitiveState> listener)
Registers a listener to be called when the primitive's state changes.
|
CompletableFuture<Void> |
close()
Closes the primitive.
|
CompletableFuture<A> |
connect()
Connects the primitive.
|
String |
name()
Returns the name of this primitive.
|
PrimitiveProtocol |
protocol()
Returns the primitive protocol.
|
void |
removeStateChangeListener(Consumer<PrimitiveState> listener)
Unregisters a previously registered listener to be called when the primitive's state changes.
|
String |
toString() |
PrimitiveType |
type()
Returns the type of primitive.
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitdelete, sync, syncpublic String name()
DistributedPrimitivename in interface DistributedPrimitivepublic PrimitiveType type()
DistributedPrimitivetype in interface DistributedPrimitivepublic PrimitiveProtocol protocol()
DistributedPrimitiveprotocol in interface DistributedPrimitivepublic void addStateChangeListener(Consumer<PrimitiveState> listener)
DistributedPrimitiveaddStateChangeListener in interface DistributedPrimitivelistener - The listener to be called when the state changes.public void removeStateChangeListener(Consumer<PrimitiveState> listener)
DistributedPrimitiveremoveStateChangeListener in interface DistributedPrimitivelistener - The listener to unregisterpublic CompletableFuture<A> connect()
public CompletableFuture<Void> close()
AsyncPrimitiveclose in interface AsyncPrimitiveCopyright © 2013–2018. All rights reserved.