|
SAP J2EE Engine Version 6.40 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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".
com.sap.engine.frame.core.locking.LockingContext| Method Summary | |
void |
assertLifetime(byte lifetime)
Returns if locking is currently allowed for the given lifetime. |
java.lang.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,
java.lang.String[] name,
java.lang.String[] argument,
char[] mode)
Locks several arguments, which belong to a name. |
void |
lock(byte lifetime,
java.lang.String[] name,
java.lang.String[] argument,
char[] mode,
int timeout)
Locks several arguments, which belong to a name. |
void |
lock(byte lifetime,
java.lang.String name,
java.lang.String argument,
char mode)
Locks an argument, which belongs to a name. |
void |
lock(byte lifetime,
java.lang.String name,
java.lang.String argument,
char mode,
int timeout)
Locks an argument, which belongs to a name. |
void |
unlock(byte lifetime,
java.lang.String[] name,
java.lang.String[] argument,
char[] mode)
Unlocks a several arguments, which belongs to a name. |
void |
unlock(byte lifetime,
java.lang.String[] name,
java.lang.String[] argument,
char[] mode,
boolean asynchronous)
Unlocks a several arguments, which belongs to a name. |
void |
unlock(byte lifetime,
java.lang.String name,
java.lang.String argument,
char mode)
Unlocks an argument, which belongs to a name. |
void |
unlock(byte lifetime,
java.lang.String name,
java.lang.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 |
public void lock(byte lifetime,
java.lang.String name,
java.lang.String argument,
char mode)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.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.LockException - if the argument is already locked
public void lock(byte lifetime,
java.lang.String name,
java.lang.String argument,
char mode,
int timeout)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.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 collisionLockException - if the argument is already locked
public void lock(byte lifetime,
java.lang.String[] name,
java.lang.String[] argument,
char[] mode)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.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 collisionLockException - if the argument is already locked
public void lock(byte lifetime,
java.lang.String[] name,
java.lang.String[] argument,
char[] mode,
int timeout)
throws com.sap.engine.frame.core.locking.LockException,
com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.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 collisionLockException - if the argument is already locked
public void unlock(byte lifetime,
java.lang.String name,
java.lang.String argument,
char mode)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.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.
public void unlock(byte lifetime,
java.lang.String name,
java.lang.String argument,
char mode,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.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.
public void unlock(byte lifetime,
java.lang.String[] name,
java.lang.String[] argument,
char[] mode)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.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.
public void unlock(byte lifetime,
java.lang.String[] name,
java.lang.String[] argument,
char[] mode,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.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.
public void unlockAll(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.IllegalArgumentException
lifetime - The lifetime can be either LIFETIME_TRANSACTION or LIFETIME_USERSESSION.
public void unlockAll(byte lifetime,
boolean asynchronous)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.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.
public void assertLifetime(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.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.TechnicalLockException - if the lifetime is currently not allowed.
public java.lang.String getCurrentOwner(byte lifetime)
throws com.sap.engine.frame.core.locking.TechnicalLockException,
java.lang.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.
public 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.
|
SAP J2EE Engine Version 6.40 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||