public class DefaultMOLockStrategy extends Object implements MOLockStrategy
DefaultMOLockStrategy
implements a simple default locking strategy that
requires a lock if a write access on a ManagedObject
is intended or if the managed object
accessed is an instance of UpdatableManagedObject
.
A managed object server that uses this lock strategy ensures that two concurrently received
SET requests will not modify the same managed object at the same time with probably undefined result.
In addition, managed objects that need to be updated regularly are protected against access whileConstructor and Description |
---|
DefaultMOLockStrategy() |
Modifier and Type | Method and Description |
---|---|
boolean |
isLockNeeded(ManagedObject managedObjectLookedUp,
MOQuery query)
Check if the server access to the provided managed object needs a lock.
|
public boolean isLockNeeded(ManagedObject managedObjectLookedUp, MOQuery query)
MOLockStrategy
isLockNeeded
in interface MOLockStrategy
managedObjectLookedUp
- the ManagedObject instance that is looked up and potentially accessed.query
- the query on which behalf the lookup took place. It also signals with
MOQuery.isWriteAccessQuery()
whether a write access is intended or not.true
if a lock is required to access the provided managed object,
false
otherwise.Copyright © 2019 SNMP4J.org. All rights reserved.