Class AtomixDistributedLock

  • All Implemented Interfaces:
    org.onosproject.store.service.AsyncDistributedLock, org.onosproject.store.service.DistributedPrimitive

    public class AtomixDistributedLock
    extends Object
    implements org.onosproject.store.service.AsyncDistributedLock
    Atomix distributed lock.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.onosproject.store.service.DistributedPrimitive

        org.onosproject.store.service.DistributedPrimitive.Status, org.onosproject.store.service.DistributedPrimitive.Type
    • Field Summary

      • Fields inherited from interface org.onosproject.store.service.DistributedPrimitive

        DEFAULT_OPERATION_TIMEOUT_MILLIS
    • Constructor Summary

      Constructors 
      Constructor Description
      AtomixDistributedLock​(io.atomix.core.lock.AsyncAtomicLock atomixLock)  
    • Constructor Detail

      • AtomixDistributedLock

        public AtomixDistributedLock​(io.atomix.core.lock.AsyncAtomicLock atomixLock)
    • Method Detail

      • name

        public String name()
        Specified by:
        name in interface org.onosproject.store.service.DistributedPrimitive
      • lock

        public CompletableFuture<org.onosproject.store.service.Version> lock()
        Specified by:
        lock in interface org.onosproject.store.service.AsyncDistributedLock
      • tryLock

        public CompletableFuture<Optional<org.onosproject.store.service.Version>> tryLock()
        Specified by:
        tryLock in interface org.onosproject.store.service.AsyncDistributedLock
      • tryLock

        public CompletableFuture<Optional<org.onosproject.store.service.Version>> tryLock​(Duration timeout)
        Specified by:
        tryLock in interface org.onosproject.store.service.AsyncDistributedLock
      • unlock

        public CompletableFuture<Void> unlock()
        Specified by:
        unlock in interface org.onosproject.store.service.AsyncDistributedLock