Example usage for org.apache.commons.transaction.locking GenericLock GenericLock

List of usage examples for org.apache.commons.transaction.locking GenericLock GenericLock

Introduction

In this page you can find the example usage for org.apache.commons.transaction.locking GenericLock GenericLock.

Prototype

public GenericLock(Object resourceId, int maxLockLevel, LoggerFacade logger) 

Source Link

Document

Creates a new lock.

Usage

From source file:org.apache.ojb.broker.locking.CommonsOJBLockManager.java

protected GenericLock createLock(Object resourceId, Object isolationId) {
    synchronized (globalLocks) {
        if (isolationId != null) {
            GenericLock lock = createIsolationLevel(resourceId, isolationId, logger);
            globalLocks.put(resourceId, lock);
            return lock;
        } else {//from   w  w w .  j  av a 2s . c o m
            GenericLock lock = new GenericLock(resourceId, maxLockLevel, logger);
            globalLocks.put(resourceId, lock);
            return lock;
        }
    }
}