Table of Contents

Interface ILockMonitor

Namespace
Geotab.Checkmate.ObjectModel.Lock
Assembly
Geotab.Checkmate.ObjectModel.dll

This interface is used to establish/keep exclusive resource lock by single client process. It is also used to get the current lock status.

public interface ILockMonitor

Methods

Acquire(ServiceLock, IStateChangeNotify, bool)

Acquires the lock.

bool Acquire(ServiceLock exclusiveLock, IStateChangeNotify stateChangeNotify, bool lockOverride)

Parameters

exclusiveLock ServiceLock

The Lock.

stateChangeNotify IStateChangeNotify

The StateChangeNotify.

lockOverride bool

If set to true, will attempt to immediately acquire the lock, even at another process expense (overrides another process that owns the lock at the time).

Returns

bool

True if requested lock is acquired.

Queue(ServiceLock, IStateChangeNotify)

Queues the lock request for asynchronous (pending) acquire job. The consuming ILockStatusChange object will be notified when the lock has been acquired.

void Queue(ServiceLock exclusiveLock, IStateChangeNotify stateChangeNotify)

Parameters

exclusiveLock ServiceLock

The Lock.

stateChangeNotify IStateChangeNotify

The StateChangeNotify.

Release(IStateChangeNotify)

Releases all locks for LockStatusChange consumer by calling corresponding Release(lock).

void Release(IStateChangeNotify stateChangeNotify)

Parameters

stateChangeNotify IStateChangeNotify

The StateChangeNotify.

Release(ServiceLock)

Releases the lock and removes it from the queue.

void Release(ServiceLock exclusiveLock)

Parameters

exclusiveLock ServiceLock

The lock.