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 and Type | Field and Description |
---|---|
protected CPGroupId |
groupId |
protected String |
name |
protected Map<Object,WaitKeyContainer<W>> |
waitKeys |
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 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() |
String |
getName() |
Map<Object,WaitKeyContainer<W>> |
getWaitKeys() |
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
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
protected CPGroupId groupId
protected String name
protected Map<Object,WaitKeyContainer<W extends WaitKey>> waitKeys
public final CPGroupId getGroupId()
public final String getName()
public final Map<Object,WaitKeyContainer<W>> getWaitKeys()
protected abstract void onSessionClose(long sessionId, Map<Long,Object> responses)
protected abstract Collection<Long> getActivelyAttachedSessions()
protected final Collection<W> getAllWaitKeys()
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.Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.