public Execution withArgs(Object arguments) { if (arguments == null) { throw new IllegalArgumentException( LocalizedStrings.ExecuteRegionFunction_THE_INPUT_0_FOR_THE_EXECUTE_FUNCTION_REQUEST_IS_NULL .toLocalizedString("args")); } return new MemberFunctionExecutor(this,arguments); } //Changing the object!!
public Execution withArgs(Object arguments) { if (arguments == null) { throw new IllegalArgumentException( LocalizedStrings.ExecuteRegionFunction_THE_INPUT_0_FOR_THE_EXECUTE_FUNCTION_REQUEST_IS_NULL .toLocalizedString("args")); } return new MemberFunctionExecutor(this,arguments); } //Changing the object!!
public Execution withCollector(ResultCollector rs) { if (rs == null) { throw new IllegalArgumentException( LocalizedStrings.ExecuteRegionFunction_THE_INPUT_0_FOR_THE_EXECUTE_FUNCTION_REQUEST_IS_NULL .toLocalizedString("Result Collector")); } return new MemberFunctionExecutor(this,rs); }
public Execution withCollector(ResultCollector rs) { if (rs == null) { throw new IllegalArgumentException( LocalizedStrings.ExecuteRegionFunction_THE_INPUT_0_FOR_THE_EXECUTE_FUNCTION_REQUEST_IS_NULL .toLocalizedString("Result Collector")); } return new MemberFunctionExecutor(this,rs); }
public InternalExecution withMemberMappedArgument( MemberMappedArgument argument) { if(argument == null){ throw new IllegalArgumentException( LocalizedStrings.ExecuteRegionFunction_THE_INPUT_0_FOR_THE_EXECUTE_FUNCTION_REQUEST_IS_NULL .toLocalizedString("MemberMappedArgs")); } return new MemberFunctionExecutor(this, argument); }
public InternalExecution withMemberMappedArgument( MemberMappedArgument argument) { if(argument == null){ throw new IllegalArgumentException( LocalizedStrings.ExecuteRegionFunction_THE_INPUT_0_FOR_THE_EXECUTE_FUNCTION_REQUEST_IS_NULL .toLocalizedString("MemberMappedArgs")); } return new MemberFunctionExecutor(this, argument); }
public final Execution onMember(DistributedSystem system, String... groups) { if (system == null) { throw new FunctionException(LocalizedStrings.FunctionService_0_PASSED_IS_NULL .toLocalizedString("DistributedSystem instance ")); } Set<DistributedMember> members = new HashSet<DistributedMember>(); for (String group : groups) { List<DistributedMember> grpMembers = new ArrayList<DistributedMember>(system.getGroupMembers(group)); if (!grpMembers.isEmpty()) { if (!RANDOM_onMember && grpMembers.contains(system.getDistributedMember())) { members.add(system.getDistributedMember()); } else { Collections.shuffle(grpMembers); members.add(grpMembers.get(0)); } } } if (members.isEmpty()) { throw new FunctionException(LocalizedStrings.FunctionService_NO_MEMBERS_FOUND_IN_GROUPS .toLocalizedString(Arrays.toString(groups))); } return new MemberFunctionExecutor(system, members); } }
public final Execution onMember(DistributedSystem system, String... groups) { if (system == null) { throw new FunctionException(LocalizedStrings.FunctionService_0_PASSED_IS_NULL .toLocalizedString("DistributedSystem instance ")); } Set<DistributedMember> members = new HashSet<DistributedMember>(); for (String group : groups) { List<DistributedMember> grpMembers = new ArrayList<DistributedMember>(system.getGroupMembers(group)); if (!grpMembers.isEmpty()) { if (!RANDOM_onMember && grpMembers.contains(system.getDistributedMember())) { members.add(system.getDistributedMember()); } else { Collections.shuffle(grpMembers); members.add(grpMembers.get(0)); } } } if (members.isEmpty()) { throw new FunctionException(LocalizedStrings.FunctionService_NO_MEMBERS_FOUND_IN_GROUPS .toLocalizedString(Arrays.toString(groups))); } return new MemberFunctionExecutor(system, members); } }
return new MemberFunctionExecutor(system); .toLocalizedString(Arrays.toString(groups))); return new MemberFunctionExecutor(system, members);
return new MemberFunctionExecutor(system); .toLocalizedString(Arrays.toString(groups))); return new MemberFunctionExecutor(system, members);
logger.debug("Executing Function on Groups: {} all members: {} members are: {}", Arrays.toString(groups), allMembers, members); Execution execution = new MemberFunctionExecutor(ds, members, resultSender); if (args != null) { execution = execution.withArgs(args);
/** * Returns an {@link Execution} object that can be used to execute a data independent function on the set of * {@link DistributedMember}s of the {@link DistributedSystem}. If one of the members goes down while dispatching or * executing the function, an Exception will be thrown. * * @param system * defines the distributed system * @param distributedMembers * set of distributed members on which {@link Function} to be executed * @throws FunctionException * if DistributedSystem instance passed is null * @since 6.0 */ public final Execution onMembers(DistributedSystem system, Set<DistributedMember> distributedMembers) { if (system == null) { throw new FunctionException(LocalizedStrings.FunctionService_0_PASSED_IS_NULL .toLocalizedString("DistributedSystem instance ")); } if (distributedMembers == null) { throw new FunctionException(LocalizedStrings.FunctionService_0_PASSED_IS_NULL .toLocalizedString("distributedMembers set ")); } return new MemberFunctionExecutor(system, distributedMembers); }
/** * Returns an {@link Execution} object that can be used to execute a data independent function on the set of * {@link DistributedMember}s of the {@link DistributedSystem}. If one of the members goes down while dispatching or * executing the function, an Exception will be thrown. * * @param system * defines the distributed system * @param distributedMembers * set of distributed members on which {@link Function} to be executed * @throws FunctionException * if DistributedSystem instance passed is null * @since 6.0 */ public final Execution onMembers(DistributedSystem system, Set<DistributedMember> distributedMembers) { if (system == null) { throw new FunctionException(LocalizedStrings.FunctionService_0_PASSED_IS_NULL .toLocalizedString("DistributedSystem instance ")); } if (distributedMembers == null) { throw new FunctionException(LocalizedStrings.FunctionService_0_PASSED_IS_NULL .toLocalizedString("distributedMembers set ")); } return new MemberFunctionExecutor(system, distributedMembers); }
/** * Returns an {@link Execution} object that can be used to execute a data independent function on a * {@link DistributedMember} of the {@link DistributedSystem}. If the member is not found in the system, the function * execution will throw an Exception. If the member goes down while dispatching or executing the function on the * member, an Exception will be thrown. * * @param system * defines the distributed system * @param distributedMember * defines a member in the distributed system * @return Execution * @throws FunctionException * if either input parameter is null * @since 6.0 * */ public final Execution onMember(DistributedSystem system, DistributedMember distributedMember) { if (system == null) { throw new FunctionException(LocalizedStrings.FunctionService_0_PASSED_IS_NULL .toLocalizedString("DistributedSystem instance ")); } if (distributedMember == null) { throw new FunctionException(LocalizedStrings.FunctionService_0_PASSED_IS_NULL .toLocalizedString("DistributedMember instance ")); } return new MemberFunctionExecutor(system, distributedMember); }
/** * Returns an {@link Execution} object that can be used to execute a data independent function on a * {@link DistributedMember} of the {@link DistributedSystem}. If the member is not found in the system, the function * execution will throw an Exception. If the member goes down while dispatching or executing the function on the * member, an Exception will be thrown. * * @param system * defines the distributed system * @param distributedMember * defines a member in the distributed system * @return Execution * @throws FunctionException * if either input parameter is null * @since 6.0 * */ public final Execution onMember(DistributedSystem system, DistributedMember distributedMember) { if (system == null) { throw new FunctionException(LocalizedStrings.FunctionService_0_PASSED_IS_NULL .toLocalizedString("DistributedSystem instance ")); } if (distributedMember == null) { throw new FunctionException(LocalizedStrings.FunctionService_0_PASSED_IS_NULL .toLocalizedString("DistributedMember instance ")); } return new MemberFunctionExecutor(system, distributedMember); }
+ " all members:" + allMembers + " members are:" + members); Execution execution = new MemberFunctionExecutor(ds, members, resultSender); if (args != null) { execution = execution.withArgs(args);