if (sender != null) {
if (numberOfTimes == 1) {
// if executing it just one time, then do so synchronously
Ping ping = sender.getClientRemotePojoFactory().getRemotePojo(Ping.class);
agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.PING_PINGING));
String ping_results = ping.ping("PING", "Ack: ");
agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.PING_PING_RESULTS, ping_results));
} else {
ClientRemotePojoFactory factory = sender.getClientRemotePojoFactory();
factory.setDeliveryGuaranteed(guaranteed);
factory.setAsynch(true, new Callback(agent));