if(result==null)
{
throw new RemoteDispatcherException(ClientMessages.failedToDispatchActionNoResponseFromServer("request wire format", 5000));
}
ServerHandshake handshake;
try
{
ByteArrayInputStream in = new ByteArrayInputStream(result.getPayloadAsBytes());
handshake = (ServerHandshake) SerializationUtils.deserialize(in, muleContext);
}
catch (Exception e)
{
throw new RemoteDispatcherException(ClientMessages.failedToDeserializeHandshakeFromServer(), e);
}
try
{
WireFormat wf = (WireFormat)ClassUtils.instanciateClass(handshake.getWireFormatClass(),
ClassUtils.NO_ARGS, getClass());
wf.setMuleContext(muleContext);
return wf;
}
catch (Exception e)
{
throw new UnsupportedWireFormatException(handshake.getWireFormatClass(), e);
}
}