Examples of LockingException


Examples of org.jasig.portal.concurrency.LockingException

        }

    }

    catch (SQLException sqle)
        { throw new LockingException("Problem deleting expired locks", sqle); }

    finally
        { if ( stmnt != null ) stmnt.close(); }
}
View Full Code Here

Examples of org.jasig.portal.concurrency.LockingException

            { stmnt.close(); }
    }
    catch (SQLException sqle)
    {
        log.error(sqle, sqle);
        throw new LockingException("Problem retrieving EntityLocks", sqle);
    }
    finally
        { RDBMServices.releaseConnection(conn); }

    return ((IEntityLock[])locks.toArray(new IEntityLock[locks.size()]));
View Full Code Here

Examples of org.jasig.portal.concurrency.LockingException

            int rc = ps.executeUpdate();
            if ( rc != 1 )
            {
                String errString = "Problem updating " + lock;
                log.error( errString);
                throw new LockingException(errString);
            }
        }
        finally
            { if ( ps != null ) ps.close(); }
    }
View Full Code Here

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

Examples of org.jasig.portal.concurrency.LockingException

* @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

Examples of org.jasig.portal.concurrency.LockingException

    }
    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

Examples of org.jasig.portal.concurrency.LockingException

    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

Examples of org.jasig.portal.concurrency.LockingException

        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

Examples of org.jasig.portal.concurrency.LockingException

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

Examples of org.jasig.portal.concurrency.LockingException

*/
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
TOP
Copyright © 2018 www.massapi.com. 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.