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));
Ping ping = factory.getRemotePojo(Ping.class);
for (int i = 0; i < numberOfTimes; i++) {
agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.PING_ASYNC_PING, i, guaranteed));
ping.ping("PING", "Ack #"
+ i