Skip to content

Commit

Permalink
ISPN-5689 Preserve compatibility with Hibernate 5.0.0.Final
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavonalle committed Aug 21, 2015
1 parent c1d600b commit d761d0d
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
18 changes: 9 additions & 9 deletions core/src/main/java/org/infinispan/cache/impl/CacheImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ final boolean remove(Object key, Object value, EnumSet<Flag> explicitFlags, Clas
private boolean removeInternal(Object key, Object value, EnumSet<Flag> explicitFlags, InvocationContext ctx) {
assertKeyValueNotNull(key, value);
RemoveCommand command = commandsFactory.buildRemoveCommand(key, value, explicitFlags);
ctx.setLockOwner(command.getLockOwner());
ctx.setLockOwner(command.getKeyLockOwner());
return (Boolean) executeCommandAndCommitIfNeeded(ctx, command);
}

Expand Down Expand Up @@ -553,7 +553,7 @@ final V remove(Object key, EnumSet<Flag> explicitFlags, ClassLoader explicitClas
private V removeInternal(Object key, EnumSet<Flag> explicitFlags, InvocationContext ctx) {
assertKeyNotNull(key);
RemoveCommand command = commandsFactory.buildRemoveCommand(key, null, explicitFlags);
ctx.setLockOwner(command.getLockOwner());
ctx.setLockOwner(command.getKeyLockOwner());
return (V) executeCommandAndCommitIfNeeded(ctx, command);
}

Expand Down Expand Up @@ -815,7 +815,7 @@ boolean lock(Collection<? extends K> keys, EnumSet<Flag> explicitFlags, ClassLoa
}
InvocationContext ctx = getInvocationContextForWrite(explicitClassLoader, UNBOUNDED, false);
LockControlCommand command = commandsFactory.buildLockControlCommand(keys, explicitFlags);
ctx.setLockOwner(command.getLockOwner());
ctx.setLockOwner(command.getKeyLockOwner());
return (Boolean) invoker.invoke(ctx, command);
}

Expand All @@ -826,7 +826,7 @@ public void applyDelta(K deltaAwareValueKey, Delta delta, Object... locksToAcqui
}
InvocationContext ctx = getInvocationContextForWrite(null, UNBOUNDED, false);
ApplyDeltaCommand command = commandsFactory.buildApplyDeltaCommand(deltaAwareValueKey, delta, Arrays.asList(locksToAcquire));
ctx.setLockOwner(command.getLockOwner());
ctx.setLockOwner(command.getKeyLockOwner());
invoker.invoke(ctx, command);
}

Expand Down Expand Up @@ -1078,7 +1078,7 @@ private V putInternal(K key, V value, Metadata metadata,
assertKeyValueNotNull(key, value);
Metadata merged = applyDefaultMetadata(metadata);
PutKeyValueCommand command = commandsFactory.buildPutKeyValueCommand(key, value, merged, explicitFlags);
ctx.setLockOwner(command.getLockOwner());
ctx.setLockOwner(command.getKeyLockOwner());
return (V) executeCommandAndCommitIfNeeded(ctx, command);
}

Expand All @@ -1104,7 +1104,7 @@ private V putIfAbsentInternal(K key, V value, Metadata metadata,
PutKeyValueCommand command = commandsFactory.buildPutKeyValueCommand(key, value, metadata, explicitFlags);
command.setPutIfAbsent(true);
command.setValueMatcher(ValueMatcher.MATCH_EXPECTED);
ctx.setLockOwner(command.getLockOwner());
ctx.setLockOwner(command.getKeyLockOwner());
return (V) executeCommandAndCommitIfNeeded(ctx, command);
}

Expand All @@ -1124,7 +1124,7 @@ final void putAll(Map<? extends K, ? extends V> map, Metadata metadata, EnumSet<
private void putAllInternal(Map<? extends K, ? extends V> map, Metadata metadata, EnumSet<Flag> explicitFlags, InvocationContext ctx) {
InfinispanCollections.assertNotNullEntries(map, "map");
PutMapCommand command = commandsFactory.buildPutMapCommand(map, metadata, explicitFlags);
ctx.setLockOwner(command.getLockOwner());
ctx.setLockOwner(command.getKeyLockOwner());
executeCommandAndCommitIfNeeded(ctx, command);
}

Expand All @@ -1146,7 +1146,7 @@ final V replace(K key, V value, Metadata metadata, EnumSet<Flag> explicitFlags,
private V replaceInternal(K key, V value, Metadata metadata, EnumSet<Flag> explicitFlags, InvocationContext ctx) {
assertKeyValueNotNull(key, value);
ReplaceCommand command = commandsFactory.buildReplaceCommand(key, null, value, metadata, explicitFlags);
ctx.setLockOwner(command.getLockOwner());
ctx.setLockOwner(command.getKeyLockOwner());
return (V) executeCommandAndCommitIfNeeded(ctx, command);
}

Expand All @@ -1169,7 +1169,7 @@ private boolean replaceInternal(K key, V oldValue, V value, Metadata metadata,
assertKeyValueNotNull(key, value);
assertValueNotNull(oldValue);
ReplaceCommand command = commandsFactory.buildReplaceCommand(key, oldValue, value, metadata, explicitFlags);
ctx.setLockOwner(command.getLockOwner());
ctx.setLockOwner(command.getKeyLockOwner());
return (Boolean) executeCommandAndCommitIfNeeded(ctx, command);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public Collection<Object> getKeysToLock() {
}

@Override
public Object getLockOwner() {
public Object getKeyLockOwner() {
return globalTx;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected final Object processVisitableCommand(ReplicableCommand cacheCommand) t
VisitableCommand vc = (VisitableCommand) cacheCommand;
final InvocationContext ctx = icf.createRemoteInvocationContextForCommand(vc, getOrigin());
if (cacheCommand instanceof RemoteLockCommand) {
ctx.setLockOwner(((RemoteLockCommand) cacheCommand).getLockOwner());
ctx.setLockOwner(((RemoteLockCommand) cacheCommand).getKeyLockOwner());
}
if (vc.shouldInvoke(ctx)) {
if (trace) log.tracef("Invoking command %s, with originLocal flag set to %b", cacheCommand, ctx.isOriginLocal());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public Collection<Object> getKeysToLock() {
}

@Override
public Object getLockOwner() {
public Object getKeyLockOwner() {
return globalTx;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Collection<Object> getKeysToLock() {
}

@Override
public final Object getLockOwner() {
public final Object getKeyLockOwner() {
return commandInvocationId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Collection<Object> getKeysToLock() {
}

@Override
public Object getLockOwner() {
public Object getKeyLockOwner() {
return commandInvocationId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private Object getLockOwner(ActionState state) {
RemoteLockCommand command = state.getCommand();
return command instanceof TransactionalRemoteLockCommand ?
((TransactionalRemoteLockCommand) command).createContext().getLockOwner() :
command.getLockOwner();
command.getKeyLockOwner();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ private void doApplyState(Address sender, int segmentId, Collection<InternalCach

boolean success = false;
try {
ctx.setLockOwner(put.getLockOwner());
ctx.setLockOwner(put.getKeyLockOwner());
interceptorChain.invoke(ctx, put);
success = true;
} finally {
Expand Down Expand Up @@ -940,7 +940,7 @@ public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.Ta
try {
InvalidateCommand invalidateCmd = commandsFactory.buildInvalidateCommand(EnumSet.of(CACHE_MODE_LOCAL, SKIP_LOCKING), keysToRemove.toArray());
InvocationContext ctx = icf.createNonTxInvocationContext();
ctx.setLockOwner(invalidateCmd.getLockOwner());
ctx.setLockOwner(invalidateCmd.getKeyLockOwner());
interceptorChain.invoke(ctx, invalidateCmd);

if (trace) log.tracef("Removed %d keys, data container now has %d keys", keysToRemove.size(), dataContainer.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public interface LockManager {
void unlockAll(Collection<?> keys, Object lockOwner);

/**
* Same as {@code unlockAll(context.getLockedKeys(), context.getLockOwner();}.
* Same as {@code unlockAll(context.getLockedKeys(), context.getKeyLockOwner();}.
*
* @param context the context with the locked keys and the lock owner.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface RemoteLockCommand {
*
* @return the lock owner of the key.
*/
Object getLockOwner();
Object getKeyLockOwner();

/**
* @return it the locks should be acquire with 0 (zero) acquisition timeout.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private void applyStateInNonTransaction(XSiteState[] chunk) {

for (XSiteState siteState : chunk) {
PutKeyValueCommand command = createPut(siteState);
ctx.setLockOwner(command.getLockOwner());
ctx.setLockOwner(command.getKeyLockOwner());
interceptorChain.invoke(ctx, command);
ctx.resetState(); //re-use same context. Old context is not longer needed
if (trace) {
Expand Down

0 comments on commit d761d0d

Please sign in to comment.