Example usage for com.liferay.portal.kernel.lock Lock isInheritable

List of usage examples for com.liferay.portal.kernel.lock Lock isInheritable

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.lock Lock isInheritable.

Prototype

public boolean isInheritable();

Source Link

Usage

From source file:com.liferay.exportimport.lar.PortletDataContextImpl.java

License:Open Source License

@Override
public void importLocks(Class<?> clazz, String key, String newKey) throws PortalException {

    Lock lock = _locksMap.get(getPrimaryKeyString(clazz, key));

    if (lock == null) {
        return;//from w  w w .  j a va2  s .c  o m
    }

    long userId = getUserId(lock.getUserUuid());

    long expirationTime = 0;

    if (lock.getExpirationDate() != null) {
        Date expirationDate = lock.getExpirationDate();

        expirationTime = expirationDate.getTime();
    }

    _lockManager.lock(userId, clazz.getName(), newKey, lock.getOwner(), lock.isInheritable(), expirationTime);
}