public class WaitNotifyServiceImpl extends Object implements WaitNotifyService, LiveOperationsTracker
SERVICE_NAME
Constructor and Description |
---|
WaitNotifyServiceImpl(NodeEngineImpl nodeEngine) |
Modifier and Type | Method and Description |
---|---|
void |
await(BlockingOperation blockingOperation)
Causes the current operation to wait in WaitNotifyService until it is notified
by a
Notifier operation or timeout specified by
BlockingOperation.getWaitTimeout() passes. |
void |
cancelWaitingOps(String serviceName,
Object objectId,
Throwable cause) |
int |
getAwaitQueueCount() |
int |
getTotalValidWaitingOperationCount() |
int |
getTotalWaitingOperationCount() |
void |
notify(Notifier notifier)
Notifies the waiting
BlockingOperation operation to wake-up and continue executing. |
void |
onClientDisconnected(String clientUuid) |
void |
onMemberLeft(MemberImpl leftMember) |
void |
onPartitionMigrate(Address thisAddress,
MigrationInfo migrationInfo) |
void |
populate(LiveOperations liveOperations)
Populate the LiveOperations
|
void |
reset() |
void |
shutdown() |
String |
toString() |
public WaitNotifyServiceImpl(NodeEngineImpl nodeEngine)
public void populate(LiveOperations liveOperations)
LiveOperationsTracker
populate
in interface LiveOperationsTracker
liveOperations
- the LiveOperations to populate.public void await(BlockingOperation blockingOperation)
WaitNotifyService
Notifier
operation or timeout specified by
BlockingOperation.getWaitTimeout()
passes.
BlockingOperation
operation will be registered using WaitNotifyKey
returned from method BlockingOperation.getWaitKey()
.
When operation is notified, it's re-executed by related scheduled mechanism.
If wait time-outs, BlockingOperation.onWaitExpire()
method is called.
This method should be called in the thread executes the actual BlockingOperation
operation.await
in interface WaitNotifyService
blockingOperation
- operation which will wait for notificationpublic void notify(Notifier notifier)
WaitNotifyService
BlockingOperation
operation to wake-up and continue executing.
A waiting operation registered with the Notifier.getNotifiedKey()
will be notified and deregistered.
This method has no effect if there isn't any operation registered
for related WaitNotifyKey
.
This method should be called in the thread executes the actual Notifier
operation.notify
in interface WaitNotifyService
notifier
- operation which will notify a corresponding waiting operationpublic int getAwaitQueueCount()
public int getTotalWaitingOperationCount()
public int getTotalValidWaitingOperationCount()
public void onMemberLeft(MemberImpl leftMember)
public void onClientDisconnected(String clientUuid)
public void onPartitionMigrate(Address thisAddress, MigrationInfo migrationInfo)
public void cancelWaitingOps(String serviceName, Object objectId, Throwable cause)
cancelWaitingOps
in interface WaitNotifyService
public void reset()
public void shutdown()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.