@SuppressWarnings("unchecked")
public <T extends Serializable> T parse(String message) throws SerializationException {
if (getMode() == SerialMode.RPC) {
try {
Serializer serializer = getSerializer();
ClientSerializationStreamReader reader = new ClientSerializationStreamReader(serializer);
reader.prepareToRead(message);
return (T) reader.readObject();
}
catch (RuntimeException e) {
throw new SerializationException(e);
}
}
else if (getMode() == SerialMode.DE_RPC) {
try {
SerializationStreamReader reader = ClientWriterFactory.createReader(message);
return (T) reader.readObject();
}
catch (RuntimeException e) {
throw new SerializationException(e);
}
} else if (getMode() == SerialMode.PLAIN) {