public class LockManagerRemoteImpl extends java.lang.Object implements LockManager, org.apache.ojb.broker.util.configuration.Configurable
LockManager interface supports locking
in distributed environments in combination with a specific lock servlet.LockManagerServlet| Modifier and Type | Class and Description |
|---|---|
static class |
LockManagerRemoteImpl.LockInfo |
| Modifier and Type | Field and Description |
|---|---|
static byte |
METHOD_BLOCK_TIMEOUT |
static byte |
METHOD_BLOCK_TIMEOUT_SET |
static byte |
METHOD_CHECK_READ |
static byte |
METHOD_CHECK_UPGRADE |
static byte |
METHOD_CHECK_WRITE |
static byte |
METHOD_LOCK_INFO |
static byte |
METHOD_LOCK_TIMEOUT |
static byte |
METHOD_LOCK_TIMEOUT_SET |
static byte |
METHOD_READ_LOCK |
static byte |
METHOD_RELEASE_LOCKS |
static byte |
METHOD_RELEASE_SINGLE_LOCK |
static byte |
METHOD_UPGRADE_LOCK |
static byte |
METHOD_WRITE_LOCK |
DEFAULT_BLOCK_TIMEOUT, DEFAULT_LOCK_TIMEOUTIL_DEFAULT, IL_NONE, IL_OPTIMISTIC, IL_READ_COMMITTED, IL_READ_UNCOMMITTED, IL_REPEATABLE_READ, IL_SERIALIZABLE, LITERAL_IL_NONE, LITERAL_IL_OPTIMISTIC, LITERAL_IL_READ_COMMITTED, LITERAL_IL_READ_UNCOMMITTED, LITERAL_IL_REPEATABLE_READ, LITERAL_IL_SERIALIZABLE| Constructor and Description |
|---|
LockManagerRemoteImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.ojb.broker.util.configuration.Configuration pConfig)
configure an object using the Configuration pConfig
|
long |
getBlockTimeout()
The maximal time to wait for acquire a lock.
|
java.lang.String |
getLockInfo()
Returns info about the used lock manager implementation and the state
of the lock manager.
|
long |
getLockTimeout()
Get the current used lock timeout value in milliseconds.
|
boolean |
hasRead(java.lang.Object key,
java.lang.Object resourceId)
Checks if there is a read lock for owner key on resource object.
|
boolean |
hasUpgrade(java.lang.Object key,
java.lang.Object resourceId)
Checks if there is a upgrade lock for lock key on resource object.
|
boolean |
hasWrite(java.lang.Object key,
java.lang.Object resourceId)
Checks if there is a write lock for lock key on resource object.
|
boolean |
readLock(java.lang.Object key,
java.lang.Object resourceId,
int isolationLevel)
Acquires a readlock for lock key on resource object.
|
boolean |
releaseLock(java.lang.Object key,
java.lang.Object resourceId)
Releases a lock for lock key on resource object.
|
void |
releaseLocks(java.lang.Object key)
Release all resource locks hold by the specified owner key.
|
byte[] |
serialize(java.lang.Object obj) |
void |
setBlockTimeout(long timeout)
noop
|
void |
setLockTimeout(long timeout)
noop
|
boolean |
upgradeLock(java.lang.Object key,
java.lang.Object resourceId,
int isolationLevel)
Acquire an upgrade lock.
|
boolean |
writeLock(java.lang.Object key,
java.lang.Object resourceId,
int isolationLevel)
Acquires a write lock for lock key on resource object.
|
public static final byte METHOD_READ_LOCK
public static final byte METHOD_WRITE_LOCK
public static final byte METHOD_UPGRADE_LOCK
public static final byte METHOD_CHECK_READ
public static final byte METHOD_CHECK_WRITE
public static final byte METHOD_CHECK_UPGRADE
public static final byte METHOD_RELEASE_SINGLE_LOCK
public static final byte METHOD_RELEASE_LOCKS
public static final byte METHOD_LOCK_INFO
public static final byte METHOD_LOCK_TIMEOUT
public static final byte METHOD_LOCK_TIMEOUT_SET
public static final byte METHOD_BLOCK_TIMEOUT
public static final byte METHOD_BLOCK_TIMEOUT_SET
public void configure(org.apache.ojb.broker.util.configuration.Configuration pConfig)
throws org.apache.ojb.broker.util.configuration.ConfigurationException
org.apache.ojb.broker.util.configuration.Configurableconfigure in interface org.apache.ojb.broker.util.configuration.ConfigurablepConfig - the Configuration object used to configure current instanceorg.apache.ojb.broker.util.configuration.ConfigurationExceptionConfigurable.configure(org.apache.ojb.broker.util.configuration.Configuration)public void setLockTimeout(long timeout)
setLockTimeout in interface LockManagertimeout - public long getLockTimeout()
LockManagergetLockTimeout in interface LockManagerpublic long getBlockTimeout()
LockManagergetBlockTimeout in interface LockManagerpublic void setBlockTimeout(long timeout)
setBlockTimeout in interface LockManagertimeout - The time to wait for acquire a lock.public java.lang.String getLockInfo()
LockManagergetLockInfo in interface LockManagerpublic boolean readLock(java.lang.Object key,
java.lang.Object resourceId,
int isolationLevel)
LockManagerreadLock in interface LockManagerkey - The owner key of the lock.resourceId - The resource to lock.isolationLevel - The isolation level of the lock.public boolean releaseLock(java.lang.Object key,
java.lang.Object resourceId)
LockManagerreleaseLock in interface LockManagerkey - The owner key of the lock.resourceId - The resource to release.public void releaseLocks(java.lang.Object key)
LockManagerreleaseLocks in interface LockManagerkey - The owner key to release all associated locks.public boolean writeLock(java.lang.Object key,
java.lang.Object resourceId,
int isolationLevel)
LockManagerwriteLock in interface LockManagerkey - The owner key of the lock.resourceId - The resource to lock.isolationLevel - The isolation level of the lock.public boolean upgradeLock(java.lang.Object key,
java.lang.Object resourceId,
int isolationLevel)
LockManagerupgradeLock in interface LockManagerkey - The owner key of the lock.resourceId - The resource to lock.isolationLevel - The isolation level of the lock.public boolean hasRead(java.lang.Object key,
java.lang.Object resourceId)
LockManagerhasRead in interface LockManagerkey - The owner key of the lock.resourceId - The resource to check.public boolean hasWrite(java.lang.Object key,
java.lang.Object resourceId)
LockManagerhasWrite in interface LockManagerkey - The owner key of the lock.resourceId - The resource to check.public boolean hasUpgrade(java.lang.Object key,
java.lang.Object resourceId)
LockManagerhasUpgrade in interface LockManagerkey - The owner key of the lock.resourceId - The resource to check.public byte[] serialize(java.lang.Object obj)
throws java.io.IOException
java.io.IOException(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30