All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cedarsoft.gdao.NullLockProvider Maven / Gradle / Ivy

There is a newer version: 1.3.7
Show newest version
package com.cedarsoft.gdao;

import com.cedarsoft.NullLock;
import org.jetbrains.annotations.NotNull;

import java.util.concurrent.locks.Lock;

/**
 *
 */
public class NullLockProvider implements LockProvider {
  @NotNull
  public static final LockProvider NULL = new LockProvider() {
    @NotNull
    public Lock getWriteLock( @NotNull Object object ) {
      return NullLock.LOCK;
    }
  };

  @NotNull
  public static  LockProvider provider() {
    return ( LockProvider ) NULL;
  }

  @NotNull
  public Lock getWriteLock( @NotNull Object object ) {
    return NullLock.LOCK;
  }
}