|
JADE Java Persistence API 1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jadeworld.jade.rootschema.Object
com.jadeworld.jade.rootschema.Lock
public class Lock
Instances of the Lock class are used to describe the locks and lock requests maintained by the JADE system.
| Field Summary |
|---|
| Fields inherited from class com.jadeworld.jade.rootschema.Object |
|---|
oid |
| Constructor Summary | |
|---|---|
Lock()
|
|
| Method Summary | |
|---|---|
char |
duration()
The read-only duration property of the Lock class is set to the value of the duration parameter of the lock request. |
java.util.Calendar |
elapsedTime()
The read-only elapsedTime property of the Lock class is set to the time that the lock request has been in place. |
char |
kind()
The read-only kind property of the Lock class is set to the kind of node lock for stable objects. |
Process |
lockedBy()
The read-only lockedBy property of the Lock class is a read-only property that is set to the process that currently holds a lock on the target object of the lock. |
Process |
requestedBy()
The read-only requestedBy property of the Lock class is a read-only property that is set to the process that submitted the lock request. |
java.util.Calendar |
requestTime()
The read-only requestTime property of the Lock class is set to the date and time of the lock request. |
Object |
target()
Used to get a reference to the object that is the target of a lock request. |
char |
type()
The read-only type property of the Lock class is set to the value of the type parameter of the lock request. |
java.util.Calendar |
waitTime()
The read-only waitTime property of the Lock class is set to the timeout parameter of the lock request. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Lock()
| Method Detail |
|---|
public char duration()
The duration parameter of the lock request specifies if the object is automatically unlocked at the end of transaction time or at the end of the current session (that is, the current thread, or process).
If a manual unlock is issued, the object is unlocked only if you are not in transaction or load state. In persistent transaction state, all unlock requests for persistent objects are ignored. Similarly, in transient transaction state, all unlock requests for shared transient objects are ignored. A session lock is therefore not released if the unlock request is made while in transaction state. To release a session lock, the unlock request must be made while not in transaction state.
The character values correspond to the Transaction_Duration and Session_Duration global constants in the LockDurations category, respectively.
public java.util.Calendar elapsedTime()
For a queued lock entry, this is the time that the request has been waiting. (If you want to obtain the total length of time from the first attempt to obtain the lock up to the time it times out, use the Lock class waitTime property.)
public char kind()
The character values correspond to the Lock class constants listed in the following table.p>
Constant Character Value Description
Kind_Local '01' Applies to stable objects and represents a shared, transient duration lock that has an associated node lock (Kind_Node) entry in the database server lock tables. There is no individual lock entry for the process in the database server lock tables (unless the process is a server application).
Kind _Node '02' Applies to stable objects and represents a shared, transient duration lock that may be held by one or more processes on the node associated with the node lock. The associated background process of the node is used as the locking process. A node lock is released when an exclusive lock request is received or the object is removed from the nodes cache and there are no processes on the associated node that have the object locked with local locks.
Kind_Normal '00' Represents a lock held by a process. It is released when the process unlocks the object. Kind_Local locks are present only on the local node on which the lock request was issued.
You can use the lockedBy property to determine the node associated with a Kind_Node, as it contains a reference to the background process of the associated node.
public Process lockedBy()
public java.util.Calendar requestTime()
public Process requestedBy()
public Object target()
public char type()
public java.util.Calendar waitTime()
If you want to obtain the length of time the lock request has been in place, use the Lock class elapsedTime property.
|
JADE Java Persistence API 1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||