public final class ConcurrencyUtil extends Object
Modifier and Type | Method and Description |
---|---|
static int |
hash(Object object)
Returns a hash code for non-null Object x.
|
static int |
selectLock(Object key,
int numberOfLocks)
Selects a lock for a key.
|
static void |
shutdownAndWaitForTermination(ExecutorService pool,
int waitSeconds)
Properly shutdown and await pool termination for an arbitrary
amount of time.
|
public static int hash(Object object)
object
- the object serving as a keypublic static int selectLock(Object key, int numberOfLocks)
key
- public static void shutdownAndWaitForTermination(ExecutorService pool, int waitSeconds) throws net.spy.memcached.OperationTimeoutException
pool
- Pool to shutdownwaitSeconds
- Seconds to wait before throwing exceptionnet.spy.memcached.OperationTimeoutException
- Thrown if the pool does not shutdown in the specified timeCopyright © 2015 Magnolia International Ltd.. All rights reserved.