|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LogicalLocking
Provides methods similar to the LockingContext, except that the owner may not be set explicitely. Instead the owner is automatically determined by the current user-session and the current transaction (every user-session/transaction has exactly one owner assigned). Because of this every method has instead of the parameter "owner" a parameter "lifetime", which determines which of the owners shall be used.
All locks are removed automatically when the session/transaction is ends.
Restriction: it is not alowed to make locks for the user-session of the system-user. This is done because of security-reasons.
Restriction: the parameter 'name' must always start with the namespace, for which this instance of the LogicalLocking was created (see LogicalLockingFactory). For example if the namespace is "XY", then valid names are "XY4711", "XY0815", "XYmeier".
LockingContext| Field Summary |
|---|
| Fields inherited from interface com.sap.engine.frame.core.locking.LockingConstants |
|---|
FILL_CHARACTER, LIFETIME_TRANSACTION, LIFETIME_USERSESSION, MAX_ARGUMENT_LENGTH, MAX_NAME_LENGTH, MAX_OWNER_LENGTH, MAX_USER_LENGTH, MODE_CHECK_EXCLUSIVE_CUMULATIVE, MODE_CHECK_EXCLUSIVE_NONCUMULATIVE, MODE_CHECK_SHARED, MODE_EXCLUSIVE_CUMULATIVE, MODE_EXCLUSIVE_NONCUMULATIVE, MODE_OPTIMISTIC, MODE_OPTIMISTIC_TO_EXCLUSIVE, MODE_SHARED, OWNER_WILDCARD_CHARACTER, WILDCARD_CHARACTER_MULTI, WILDCARD_CHARACTER_SINGLE |
| Method Summary | |
|---|---|
void |
assertLifetime(byte lifetime)
Returns if locking is currently allowed for the given lifetime. |
String |
getCurrentOwner(byte lifetime)
Returns the current owner-id, to which all locks belong. |
long |
getUniqueIncreasingNumber()
Returns a number with the following properties: every method-call returns a higher number than the previous ones the number contains the timestamp of the central server, so this will work correctly in a distrubuted environment and also after a restart of the cluster This number can be used for every purpose, it is not locking-specific. |
void |
lock(byte lifetime,
String[] name,
String[] argument,
char[] mode)
Locks several arguments, which belong to a name. |
void |
lock(byte lifetime,
String[] name,
String[] argument,
char[] mode,
int timeout)
Locks several arguments, which belong to a name. |
void |
lock(byte lifetime,
String name,
String argument,
char mode)
Locks an argument, which belongs to a name. |
void |
lock(byte lifetime,
String name,
String argument,
char mode,
int timeout)
Locks an argument, which belongs to a name. |
void |
unlock(byte lifetime,
String[] name,
String[] argument,
char[] mode)
Unlocks a several arguments, which belongs to a name. |
void |
unlock(byte lifetime,
String[] name,
String[] argument,
char[] mode,
boolean asynchronous)
Unlocks a several arguments, which belongs to a name. |
void |
unlock(byte lifetime,
String name,
String argument,
char mode)
Unlocks an argument, which belongs to a name. |
void |
unlock(byte lifetime,
String name,
String argument,
char mode,
boolean asynchronous)
Unlocks an argument, which belongs to a name. |
void |
unlockAll(byte lifetime)
Unlocks all names/arguments. |
void |
unlockAll(byte lifetime,
boolean asynchronous)
Unlocks all names/arguments. |
| Method Detail |
|---|
void lock(byte lifetime,
String name,
String argument,
char mode)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
name - The name, to which the argument belongs. The maximum size is MAX_NAME_LENGTH characters.argument - The argument which to lock. The maximum size is MAX_ARGUMENT_LENGTH characters.mode - The mode can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.
com.sap.engine.frame.core.locking.LockException - if the argument is already locked
com.sap.engine.frame.core.locking.TechnicalLockException
IllegalArgumentException
void lock(byte lifetime,
String name,
String argument,
char mode,
int timeout)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
name - The name, to which the argument belongs. The maximum size is MAX_NAME_LENGTH characters.argument - The argument which to lock. The maximum size is MAX_ARGUMENT_LENGTH characters.mode - The mode can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.timeout - time period in milliseconds within this the lock will be requested several times if there is a lock collision
com.sap.engine.frame.core.locking.LockException - if the argument is already locked
com.sap.engine.frame.core.locking.TechnicalLockException
IllegalArgumentException
void lock(byte lifetime,
String[] name,
String[] argument,
char[] mode)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
name - The names, to which the argument belongs. The maximum size is MAX_NAME_LENGTH characters.argument - The arguments which to lock. The maximum size is MAX_ARGUMENT_LENGTH characters.mode - The modes can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.timeout - time period in milliseconds within the lock will be requested several times if there is a lock collision
com.sap.engine.frame.core.locking.LockException - if the argument is already locked
com.sap.engine.frame.core.locking.TechnicalLockException
IllegalArgumentException
void lock(byte lifetime,
String[] name,
String[] argument,
char[] mode,
int timeout)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
name - The names, to which the argument belongs. The maximum size is MAX_NAME_LENGTH characters.argument - The arguments which to lock. The maximum size is MAX_ARGUMENT_LENGTH characters.mode - The modes can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.timeout - time period in milliseconds within the locks will be requested several times if there is a lock collision
com.sap.engine.frame.core.locking.LockException - if the argument is already locked
com.sap.engine.frame.core.locking.TechnicalLockException
IllegalArgumentException
void unlock(byte lifetime,
String name,
String argument,
char mode)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
name - The name, to which the argument belongs. The maximum size is MAX_NAME_LENGTH characters.argument - The argument which to unlock. The maximum size is MAX_ARGUMENT_LENGTH characters.mode - The mode can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.
com.sap.engine.frame.core.locking.TechnicalLockException
IllegalArgumentException
void unlock(byte lifetime,
String name,
String argument,
char mode,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
name - The name, to which the argument belongs. The maximum size is MAX_NAME_LENGTH characters.argument - The argument which to unlock. The maximum size is MAX_ARGUMENT_LENGTH characters.mode - The mode can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.asynchronous - If true, then the unlock may be done asynchronously, otherwise it is guaranteed to be done synchronously.
com.sap.engine.frame.core.locking.TechnicalLockException
IllegalArgumentException
void unlock(byte lifetime,
String[] name,
String[] argument,
char[] mode)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
name - The namea, to which the argument belongs. The maximum size is MAX_NAME_LENGTH characters.argument - The argumenta which to unlock. The maximum size is MAX_ARGUMENT_LENGTH characters.mode - The modea can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.
com.sap.engine.frame.core.locking.TechnicalLockException
IllegalArgumentException
void unlock(byte lifetime,
String[] name,
String[] argument,
char[] mode,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
name - The namea, to which the argument belongs. The maximum size is MAX_NAME_LENGTH characters.argument - The argumenta which to unlock. The maximum size is MAX_ARGUMENT_LENGTH characters.mode - The modea can be MODE_SHARED or MODE_EXCLUSIVE_CUMULATIVE or MODE_EXCLUSIVE_NONCUMULATIVE.lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.asynchronous - If true, then the unlock may be done asynchronously, otherwise it is guaranteed to be done synchronously.
com.sap.engine.frame.core.locking.TechnicalLockException
IllegalArgumentException
void unlockAll(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.
com.sap.engine.frame.core.locking.TechnicalLockException
IllegalArgumentException
void unlockAll(byte lifetime,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.asynchronous - If true, then the unlock may be done asynchronously, otherwise it is guaranteed to be done synchronously.
com.sap.engine.frame.core.locking.TechnicalLockException
IllegalArgumentException
void assertLifetime(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
This method is typically not needed to use the locking. It is meant mainly for debugging-purposes and to support better tracing.
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.
com.sap.engine.frame.core.locking.TechnicalLockException - if the lifetime is currently not allowed.
IllegalArgumentException
String getCurrentOwner(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
IllegalArgumentException
This method is not needed to use the locking. It is meant mainly for debugging-purposes and to support better tracing.
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.
com.sap.engine.frame.core.locking.TechnicalLockException
IllegalArgumentException
long getUniqueIncreasingNumber()
throws com.sap.engine.frame.core.locking.TechnicalLockException
ATTENTION: if the system-time of the central server is changed this will probably not work correctly any more.
com.sap.engine.frame.core.locking.TechnicalLockException| Access Rights |
|---|
| SC | DC |
|---|---|
[sap.com] ENGINEAPI
|
[sap.com] applocking
|
[sap.com] ENGFACADE
|
[sap.com] tc/je/locking/api
|
[sap.com] CORE-TOOLS
|
[sap.com] com.sap.engine.client.lib
|
|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||