@SuppressWarnings("unchecked") protected <T> List<T> callMethodOnPartition(String methodName, Object[] args, Class<?>[] types) throws Exception { GroupRpcDispatcher dispatcher = this.partition; return (List<T>) dispatcher.callMethodOnCluster(this.name, methodName, args, types, true); }
/** Back out of a failed attempt by the local node to lock */ private void cleanup(Serializable categoryName, ClusterLockState category) { try { rpcDispatcher.callMethodOnCluster(getServiceHAName(), "releaseRemoteLock", new Object[]{categoryName, me}, RELEASE_REMOTE_LOCK_TYPES, true); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException("Failed releasing remote lock", e); } finally { if (category.state.compareAndSet(ClusterLockState.State.REMOTE_LOCKING, ClusterLockState.State.UNLOCKED) == false) { category.state.compareAndSet(ClusterLockState.State.LOCAL_LOCKING, ClusterLockState.State.UNLOCKED); } } }
List<RemoteLockResponse> rsps = rpcDispatcher.callMethodOnCluster(getServiceHAName(), "remoteLock", new Object[]{lockId, me, new Long(left)}, REMOTE_LOCK_TYPES, RemoteLockResponse.class, true, null, rpcDispatcher.getMethodCallTimeout(), false);
getGroupRpcDispatcher().callMethodOnCluster(getServiceHAName(), "releaseRemoteLock", new Object[]{lockId, myself}, RELEASE_REMOTE_LOCK_TYPES, true);