GigaSpaces XAP 10.0.1 API

org.openspaces.core.map
Class LockHandle

java.lang.Object
  extended by org.openspaces.core.map.LockHandle
All Implemented Interfaces:
Externalizable, Serializable

public class LockHandle
extends Object
implements Externalizable

A lock handle allowing to perform map operations when the key is locked. Internally holds the transaction representing the lock and it can be accessed to be passed to any operation that needs to be performed under the same lock.

With GigaMap this is done automatically by just passing the lock handle to an operation.

Author:
kimchy
See Also:
Serialized Form

Constructor Summary
LockHandle()
           
 
Method Summary
 Object getKey()
          Returns the key that is locked.
 Transaction getTransaction()
          Returns the transaction representing the lock on the given key.
 void readExternal(ObjectInput in)
           
 void unlock()
          Unlocks the given key.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockHandle

public LockHandle()
Method Detail

unlock

public void unlock()
Unlocks the given key.


getTransaction

public Transaction getTransaction()
Returns the transaction representing the lock on the given key.


getKey

public Object getKey()
Returns the key that is locked.


writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

GigaSpaces XAP 10.0.1 API

Copyright © GigaSpaces.