// generate user classes
generateUserClasses();
routeUserClasses();
} catch (ParserConfigurationException e) {
throw new TranslationException(this, "Unable to generate XML for queue network.", e);
}
// serialize the document
try {
DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
DOMImplementationLS impl = (DOMImplementationLS) registry.getDOMImplementation("LS");
LSSerializer writer = impl.createLSSerializer();
LSOutput output = impl.createLSOutput();
output.setByteStream(outStream);
writer.write(network.getXmlDoc(), output);
} catch (ClassCastException e) {
throw new TranslationException(this, "Unable to generate XML for queue network.", e);
} catch (ClassNotFoundException e) {
throw new TranslationException(this, "Unable to generate XML for queue network.", e);
} catch (InstantiationException e) {
throw new TranslationException(this, "Unable to generate XML for queue network.", e);
} catch (IllegalAccessException e) {
throw new TranslationException(this, "Unable to generate XML for queue network.", e);
}
}