protected void callAsyncMethodOnPartition(String methodName, Object[] args, Class<?>[] types) throws Exception { this.partition.callAsynchMethodOnCluster(this.name, methodName, args, types, true); }
protected void _do_rpc_invalidate_all(String invalidationGroupName, boolean asynch) { Object[] params = new Object[] { invalidationGroupName }; try { if (asynch) { this.partition.callAsynchMethodOnCluster(this.RPC_HANDLER_NAME, "_rpc_invalidate_all", params, rpc_invalidate_all_types, true); } else { this.partition.callMethodOnCluster(this.RPC_HANDLER_NAME, "_rpc_invalidate_all", params, rpc_invalidate_all_types, true); } } catch (Exception e) { this.log.debug("Distributed invalidation (2) has failed for group " + invalidationGroupName + " (Bridge: " + this.bridgeName + ")"); } }
protected void _do_rpc_invalidates(String invalidationGroupName, Serializable[] keys, boolean asynch) { Object[] params = new Object[] { invalidationGroupName, keys }; try { if (asynch) { this.partition.callAsynchMethodOnCluster(this.RPC_HANDLER_NAME, "_rpc_invalidates", params, rpc_invalidates_types, true); } else { this.partition.callMethodOnCluster(this.RPC_HANDLER_NAME, "_rpc_invalidates", params, rpc_invalidates_types, true); } } catch (Exception e) { this.log.debug("Distributed invalidation (2) has failed for group " + invalidationGroupName + " (Bridge: " + this.bridgeName + ")"); } }
protected void _do_rpc_batchInvalidate(BatchInvalidation[] invalidations, boolean asynch) { Object[] params = new Object[] { invalidations }; try { if (asynch) { this.partition.callAsynchMethodOnCluster(this.RPC_HANDLER_NAME, "_rpc_batchInvalidate", params, rpc_batch_invalidate_types, true); } else { this.partition.callMethodOnCluster(this.RPC_HANDLER_NAME, "_rpc_batchInvalidate", params, rpc_batch_invalidate_types, true); } } catch (Exception e) { this.log.debug("Distributed invalidation (3) has failed (Bridge: " + this.bridgeName + ")"); } }
protected void _do_rpc_invalidate(String invalidationGroupName, Serializable key, boolean asynch) { Object[] params = new Object[] { invalidationGroupName, key }; try { if (asynch) { this.partition.callAsynchMethodOnCluster(this.RPC_HANDLER_NAME, "_rpc_invalidate", params, rpc_invalidate_types, true); } else { this.partition.callMethodOnCluster(this.RPC_HANDLER_NAME, "_rpc_invalidate", params, rpc_invalidate_types, true); } } catch (Exception e) { this.log.debug("Distributed invalidation (1) has failed for group " + invalidationGroupName + " (Bridge: " + this.bridgeName + ")"); } }
@Override public void remove(String key) throws Exception { // optimisation: we don't make a costly network call // if there is nothing to remove if (this.localReplicants.containsKey(key)) { Object[] args = { key, this.partition.getNodeName() }; this.partition.callAsynchMethodOnCluster(SERVICE_NAME, "_remove", args, remove_types, true); this.removeLocal(key); } }
@SuppressWarnings("unchecked") protected void callAsyncMethodOnPartition(String methodName, Object[] args, Class[] types) throws Exception { this.getHAPartition().callAsynchMethodOnCluster(this.getHAServiceKey(), methodName, args, types, true); }
this.partition.callAsynchMethodOnCluster(SERVICE_NAME, "_add", args, add_types, true);
private void executePush(SynchronizationId<?> id, SynchronizationReadAction<?> action) throws Exception { int lastRead = 0; while (lastRead > -1) { try { ByteChunk chunk = action.getNextBytes(); Object[] args = new Object[]{ id, action.getRepositoryContentModification().getItem(), chunk}; // JBAS-7102 -- send chunks async; if there is a problem applying we'll // fail in the prepare phase this.partition.callAsynchMethodOnCluster(getServiceHAName(), "pushBytes", args, PUSH_BYTES_TYPES, true); lastRead = chunk.getByteCount(); } catch (Exception e) { action.cancel(); throw e; } } action.complete(); }