@Override public final LockResult lockShared(Transaction txn, byte[] tkey) throws LockFailureException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.lockShared(txn, key); } throw fail(); }
@Override public final LockResult tryLockExclusive(Transaction txn, byte[] tkey, long nanosTimeout) throws DeadlockException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.tryLockExclusive(txn, key, nanosTimeout); } throw fail(); }
@Override public final LockResult tryLockExclusive(Transaction txn, byte[] tkey, long nanosTimeout) throws DeadlockException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.tryLockExclusive(txn, key, nanosTimeout); } throw fail(); }
@Override public final LockResult lockUpgradable(Transaction txn, byte[] tkey) throws LockFailureException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.lockUpgradable(txn, key); } throw fail(); }
@Override public final LockResult tryLockUpgradable(Transaction txn, byte[] tkey, long nanosTimeout) throws DeadlockException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.tryLockUpgradable(txn, key, nanosTimeout); } throw fail(); }
@Override public final LockResult tryLockExclusive(Transaction txn, byte[] tkey, long nanosTimeout) throws DeadlockException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.tryLockExclusive(txn, key, nanosTimeout); } throw fail(); }
@Override public LockResult lock() throws IOException { if (mKey != null && mSource.key() == null) { throw TransformedView.fail(); } return mSource.lock(); }
@Override public final LockResult lockShared(Transaction txn, byte[] tkey) throws LockFailureException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.lockShared(txn, key); } throw fail(); }
@Override public final LockResult tryLockShared(Transaction txn, byte[] tkey, long nanosTimeout) throws DeadlockException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.tryLockShared(txn, key, nanosTimeout); } throw fail(); }
@Override public final LockResult lockUpgradable(Transaction txn, byte[] tkey) throws LockFailureException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.lockUpgradable(txn, key); } throw fail(); }
@Override public final LockResult lockUpgradable(Transaction txn, byte[] tkey) throws LockFailureException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.lockUpgradable(txn, key); } throw fail(); }
@Override public final LockResult lockShared(Transaction txn, byte[] tkey) throws LockFailureException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.lockShared(txn, key); } throw fail(); }
@Override public final LockResult tryLockUpgradable(Transaction txn, byte[] tkey, long nanosTimeout) throws DeadlockException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.tryLockUpgradable(txn, key, nanosTimeout); } throw fail(); }
@Override public final LockResult lockCheck(Transaction txn, byte[] tkey) throws ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.lockCheck(txn, key); } throw fail(); }
@Override public final LockResult lockExclusive(Transaction txn, byte[] tkey) throws LockFailureException, ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.lockExclusive(txn, key); } throw fail(); }
@Override public final LockResult lockCheck(Transaction txn, byte[] tkey) throws ViewConstraintException { byte[] key = inverseTransformKey(tkey); if (key != null) { return mSource.lockCheck(txn, key); } throw fail(); }
@Override public void store(final Transaction txn, final byte[] tkey, final byte[] tvalue) throws IOException { final byte[] key = inverseTransformKey(tkey); if (key == null) { throw fail(); } mSource.store(txn, key, mTransformer.inverseTransformValue(tvalue, key, tkey)); }
@Override public LockResult load() throws IOException { final byte[] tkey = mKey; ViewUtils.positionCheck(tkey); if (mSource.key() == null) { throw TransformedView.fail(); } mValue = NOT_LOADED; return transformCurrent(mSource.load(), tkey); }
@Override public void store(final byte[] tvalue) throws IOException { final byte[] tkey = mKey; ViewUtils.positionCheck(tkey); final Cursor c = mSource; final byte[] key = c.key(); if (key == null) { throw TransformedView.fail(); } c.store(mTransformer.inverseTransformValue(tvalue, key, tkey)); mValue = tvalue; }
@Override public byte[] exchange(final Transaction txn, final byte[] tkey, final byte[] tvalue) throws IOException { final byte[] key = inverseTransformKey(tkey); if (key == null) { throw fail(); } return mTransformer.transformValue (mSource.exchange(txn, key, mTransformer.inverseTransformValue(tvalue, key, tkey)), key, tkey); }