Class AtomixDistributedLock

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

    public class AtomixDistributedLock
    extends java.lang.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)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<org.onosproject.store.service.Version> lock()  
      java.lang.String name()  
      java.util.concurrent.CompletableFuture<java.util.Optional<org.onosproject.store.service.Version>> tryLock()  
      java.util.concurrent.CompletableFuture<java.util.Optional<org.onosproject.store.service.Version>> tryLock​(java.time.Duration timeout)  
      java.util.concurrent.CompletableFuture<java.lang.Void> unlock()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.onosproject.store.service.AsyncDistributedLock

        asLock, asLock, primitiveType
      • Methods inherited from interface org.onosproject.store.service.DistributedPrimitive

        addStatusChangeListener, applicationId, destroy, removeStatusChangeListener, statusChangeListeners
    • Constructor Detail

      • AtomixDistributedLock

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

      • name

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

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

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

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

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