W
- concrete type of the WaitKeypublic abstract class BlockingResource<W extends WaitKey> extends Object implements DataSerializable
BlockingResource
may not return a response
at commit-time. Such operations register WaitKey
instances.
Then, their wait keys can be completed in future when some other operations
are committed or a timeout occurs.Modifier | Constructor and Description |
---|---|
protected |
BlockingResource() |
protected |
BlockingResource(CPGroupId groupId,
String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
addWaitKey(Object waitKeyId,
W waitKey) |
protected void |
clearWaitKeys() |
protected void |
cloneForSnapshot(BlockingResource<W> clone) |
protected abstract Collection<Long> |
getActivelyAttachedSessions()
Returns a non-null collection of session ids that the current state of the resource is attached to.
|
protected Collection<W> |
getAllWaitKeys() |
CPGroupId |
getGroupId() |
Map<Object,WaitKeyContainer<W>> |
getInternalWaitKeysMap() |
String |
getName() |
protected WaitKeyContainer<W> |
getWaitKeyContainer(Object waitKeyId) |
protected String |
internalToString() |
protected abstract void |
onSessionClose(long sessionId,
Map<Long,Object> responses)
Called when a session is closed.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
protected void |
removeWaitKey(Object waitKeyId) |
protected Iterator<WaitKeyContainer<W>> |
waitKeyContainersIterator() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public final CPGroupId getGroupId()
public final String getName()
public final Map<Object,WaitKeyContainer<W>> getInternalWaitKeysMap()
protected abstract void onSessionClose(long sessionId, Map<Long,Object> responses)
protected abstract Collection<Long> getActivelyAttachedSessions()
protected final WaitKeyContainer<W> getWaitKeyContainer(Object waitKeyId)
protected final void removeWaitKey(Object waitKeyId)
protected final Collection<W> getAllWaitKeys()
protected final Iterator<WaitKeyContainer<W>> waitKeyContainersIterator()
protected final void clearWaitKeys()
protected final void cloneForSnapshot(BlockingResource<W> clone)
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.protected final String internalToString()
Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.