/** * Convenience method that simply calls {@link #weakLockManager(Function)} * with the identity function. So all inputs map directly to an individual * lock. * * @param <T> the type of the thing used to look up locks * @deprecated use {@link ManagedLocks#weakManagedLockFactory()} instead. */ @Deprecated public static <T> LockManager<T> weakLockManager() { return weakLockManager(Functions.<T> identity()); }
/** * Convenience method that calls * {@link ManagedLocks#weakManagedLockFactory(Function)} using the * {@link Functions#identity() identity function} for striping, essentially * meaning that unique input will have its own lock. * * @param <T> the type of the thing used to look up locks * @see #weakManagedLockFactory(Function, Supplier) */ public static @NotNull <T> com.atlassian.util.concurrent.Function<T, ManagedLock> weakManagedLockFactory() { return weakManagedLockFactory(Functions.<T> identity()); }
/** * A convenience method for calling * {@link #weakReadWriteManagedLockFactory(Function)} that uses the * {@link Functions#identity() identity function} for striping, essentially * meaning that unique input will have its own lock. * * @param <T> the type of the thing used to look up locks * @return a new {@link Function} that provides the appropriate * {@link ReadWrite} for the argument {@link ManagedLock.ReadWrite} instances * that stores created instances with weak references. */ public static @NotNull <T> com.atlassian.util.concurrent.Function<T, ManagedLock.ReadWrite> weakReadWriteManagedLockFactory() { return weakReadWriteManagedLockFactory(Functions.<T> identity()); }