{
try
{
InputStream resourceStream = resourceClass.getResourceAsStream(resourceName);
if (resourceStream == null)
throw new ConfigurationException("Resource not found: '"+resourceName+"'");
try
{
WSDDDocument doc = new WSDDDocument(XMLUtils.newDocument(resourceStream));
deployment = doc.getDeployment();
deployment.configureEngine(engine);
engine.refreshGlobalOptions();
}
finally
{
resourceStream.close();
}
}
catch (ConfigurationException e)
{
throw e;
}
catch (Exception e)
{
throw new ConfigurationException(e);
}
}