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

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

Introduction

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

Prototype

public String getOwner();

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;//  w w w.ja v  a2 s  .  com
    }

    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);
}