@Override
public MessageSerializer locateSerializer(OutputStream out, AMFMessage outMessage) {
MessageSerializer serializer = null;
try {
Class<SerializeWorker> workerClass = serializeWorkers.get(outMessage.getVersion());
SerializeWorker worker = workerClass.newInstance();
worker.setOutputStream(out);
worker.setAliasRegistry(aliasRegistry);
worker.setProxyRegistry(proxyRegistry);
serializer = new AMFMessageSerializer(worker);
} catch (Exception e) {
LogWriter.error(getClass(), "Failed to create serializer: " + e, e);
}