站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 Cache API Documentation 英文版文档

LockMap (JBossCache API) - JBoss 4.0.1 sp1 Cache API Documentation 英文版文档


org.jboss.cache.lock
Class LockMap

java.lang.Object
  extended byorg.jboss.cache.lock.LockMap

public class LockMap
extends Object

Provide lock ownership mapping.

Version:
$Id: LockMap.java,v 1.4.6.1 2004/12/14 08:19:23 starksm Exp $
Author:
Ben Wang

Field Summary
static int OWNER_ANY
           
static int OWNER_READ
           
static int OWNER_WRITE
           
 
Constructor Summary
LockMap()
           
 
Method Summary
 void addReader(Object owner)
          Adding a reader owner.
 void addWriter(Object owner)
          Adding a writer owner.
 boolean isOwner(Object owner, int ownership)
          Check whether this owner has reader or writer ownership.
 String printInfo()
          Debugging information.
 List readerOwners()
           
 void removeAll()
          Remove all ownership.
 boolean removeReader(Object owner)
          Remove reader ownership.
 Object removeWriter(Object owner)
          Remove writer ownership.
 boolean upgrade(Object owner)
          Upgrading current reader ownership to writer one.
 Object writerOwner()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OWNER_ANY

public static final int OWNER_ANY
See Also:
Constant Field Values

OWNER_READ

public static final int OWNER_READ
See Also:
Constant Field Values

OWNER_WRITE

public static final int OWNER_WRITE
See Also:
Constant Field Values
Constructor Detail

LockMap

public LockMap()
Method Detail

isOwner

public boolean isOwner(Object owner,
                       int ownership)
Check whether this owner has reader or writer ownership.

Parameters:
owner -
ownership - Either OWNER_ANY, OWNER_READ, or OWNER_WRITE.
Returns:

addReader

public void addReader(Object owner)
Adding a reader owner.

Parameters:
owner -

addWriter

public void addWriter(Object owner)
Adding a writer owner.

Parameters:
owner -

upgrade

public boolean upgrade(Object owner)
                throws OwnerNotExistedException
Upgrading current reader ownership to writer one.

Parameters:
owner -
Returns:
True if successful.
Throws:
OwnerNotExistedException

readerOwners

public List readerOwners()
Returns:
List of reader owner objects. Size 0 if not found.

writerOwner

public Object writerOwner()
Returns:
Writer owner object. Null if none.

removeReader

public boolean removeReader(Object owner)
Remove reader ownership.

Parameters:
owner -
Returns:
The owner object. Null if not found.

removeWriter

public Object removeWriter(Object owner)
Remove writer ownership.

Parameters:
owner -
Returns:
The owner object. Null if not found.

removeAll

public void removeAll()
Remove all ownership.


printInfo

public String printInfo()
Debugging information.

Returns:


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.