@Override
    public boolean acquire(long time, TimeUnit unit) throws Exception
    {
        Exception                   exception = null;
        List<InterProcessLock>      acquired = Lists.newArrayList();
        boolean                     success = true;
        for ( InterProcessLock lock : locks )
        {
            try
            {
                if ( unit == null )
                {
                    lock.acquire();
                    acquired.add(lock);
                }
                else
                {
                    if ( lock.acquire(time, unit) )
                    {
                        acquired.add(lock);
                    }
                    else
                    {
                        success = false;
                        break;
                    }
                }
            }
            catch ( Exception e )
            {
                ThreadUtils.checkInterrupted(e);
                success = false;
                exception = e;
            }
        }

        if ( !success )
        {
            for ( InterProcessLock lock : reverse(acquired) )
            {
                try
                {
                    lock.release();
                }
                catch ( Exception e )
                {
                    ThreadUtils.checkInterrupted(e);
                    // ignore
                }
            }
        }

        if ( exception != null )
        {
            throw exception;
        }
        
        return success;
    }
@ Override public boolean acquire ( long time , TimeUnit unit ) throws Exception { Exception exception = null ; List < InterProcessLock > acquired = Lists . newArrayList ( ) ; boolean success = true ; for ( InterProcessLock lock : locks ) { try { if ( unit == null ) { lock . acquire ( ) ; acquired . add ( lock ) ; } else { if ( lock . acquire ( time , unit ) ) { acquired . add ( lock ) ; } else { success = false ; break ; } } } catch ( Exception e ) { ThreadUtils . checkInterrupted ( e ) ; success = false ; exception = e ; } } if ( ! success ) { for ( InterProcessLock lock : reverse ( acquired ) ) { try { lock . release ( ) ; } catch ( Exception e ) { ThreadUtils . checkInterrupted ( e ) ; } } } if ( exception != null ) { throw exception ; } return success ; }
{@inheritDoc}