repositoryEntries.add(repositoryEntry);
RepositoryServiceConfiguration newRepositoryServiceConfiguration =
new RepositoryServiceConfiguration(serviceConfiguration.getDefaultRepositoryName(), repositoryEntries);
IBindingFactory bfact;
try
{
bfact = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<IBindingFactory>()
{
public IBindingFactory run() throws Exception
{
return BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
}
});
}
catch (PrivilegedActionException pae)
{
Throwable cause = pae.getCause();
if (cause instanceof JiBXException)
{
throw (JiBXException) cause;
}
else if (cause instanceof RuntimeException)
{
throw (RuntimeException) cause;
}
else
{
throw new RuntimeException(cause);
}
}
IMarshallingContext mctx = bfact.createMarshallingContext();
mctx.marshalDocument(newRepositoryServiceConfiguration, "ISO-8859-1", null, saveStream);
saveStream.close();
writer.writeStartElement("original-workspace-config");