Package org.jasig.portal.concurrency

Examples of org.jasig.portal.concurrency.LockingException


            { primDeleteExpired(new Date(), lock.getEntityType(), lock.getEntityKey(), conn); }
            primUpdate(lock, newExpiration, newLockType, conn);
        }

        catch (SQLException sqle)
        { throw new LockingException("Problem updating " + lock, sqle); }
        finally
        { RDBMServices.releaseConnection(conn); }
    }
View Full Code Here


* @exception org.jasig.portal.concurrency.LockingException
*/
public void convert(IEntityLock lock, int newType, int newDuration) throws LockingException
{
    if ( lock.getLockType() == newType )
       { throw new LockingException("Could not convert " + lock + " : old and new lock TYPEs are the same."); }

    if ( ! isValidLockType(newType)  )
        { throw new LockingException("Could not convert " + lock + " : lock TYPE " + newType + " is invalid."); }

    if ( ! isValid(lock) )
        { throw new LockingException("Could not convert " + lock + " : lock is invalid."); }

    if ( newType == WRITE_LOCK && retrieveLocks(lock.getEntityType(), lock.getEntityKey(), null).length > 1 )
        { throw new LockingException("Could not convert " + lock + " : another lock already exists."); }

    if ( newType == READ_LOCK )
        { /* Can always convert to READ */ }

    Date newExpiration = getNewExpiration(newDuration);
View Full Code Here

    }
    catch ( Exception e )
    {
        eMsg = "ReferenceEntityLockingService.initialize(): Failed to instantiate entity lock store. " + e;
        log.error( eMsg);
        throw new LockingException(eMsg);
    }

    try
    {
        int lockDuration = PropertiesManager.getPropertyAsInt
View Full Code Here

    IEntityLock[] locks = retrieveLocks(entityType, entityKey, null);

    if ( lockType == WRITE_LOCK )
    {
        if ( locks.length > 0 )
            { throw new LockingException("Could not create lock: entity already locked."); }
       
        getLockStore().add(newLock);

        locks = retrieveLocks(entityType, entityKey, null);
        if ( locks.length > 1 // another lock snuck in
        {
            release(newLock);
            throw new LockingException("Could not create lock: entity already locked.");
        }
    }

    else // ( lockType == READ_LOCK )
    {
        for ( int i = 0; i<locks.length; i++ )
        {
            if ( locks[i].getLockType() == WRITE_LOCK )
                { throw new LockingException("Could not create lock: entity already write locked."); }
            else
            {
                if ( locks[i].equals(newLock) )
                {
                    // another read lock from the same owner; bump the expiration time.
View Full Code Here

        Date newExpiration = getNewExpiration(duration);
        getLockStore().update(lock, newExpiration);
        ((EntityLockImpl)lock).setExpirationTime(newExpiration);
    }
    else
        { throw new LockingException("Could not renew " + lock + " : lock is invalid."); }
}
View Full Code Here

    try
        { return ReferenceEntityLockService.singleton(); }
    catch ( LockingException le )
    {
        log.error( "ReferenceEntityLockServiceFactory.newLockService(): " + le);
        throw new LockingException(le);
    }
}
View Full Code Here

*/
public void update(IEntityLock lock, java.util.Date newExpiration, Integer newLockType)
throws LockingException
{
    if ( find(lock) == null )
        { throw new LockingException("Problem updating " + lock + " : not found in store."); }
    primAdd(lock, newExpiration);
}
View Full Code Here

    }
    catch (Exception e)
    {
        eMsg = "EntityLockService.initialize(): Problem creating entity lock service...";
        log.error( eMsg, e);
        throw new LockingException(eMsg, e);
    }
}
View Full Code Here

TOP

Related Classes of org.jasig.portal.concurrency.LockingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.