// Send chat message to targetID
client.sendChat(targetID, msgToSend);
// Get shared object container adapter
ISharedObjectContainer socontainer = (ISharedObjectContainer) client
.getContainer().getAdapter(ISharedObjectContainer.class);
// Create and add shared object to container
TrivialSharedObject sharedObject = new TrivialSharedObject();
socontainer.getSharedObjectManager().addSharedObject(
IDFactory.getDefault().createStringID(
TrivialSharedObject.class.getName()), sharedObject,
null);
// Send messages via shared object...and wait a short while before sending the next one