}
fileURL = wsClass.getClassLoader().getResource(resourcePath);
}
if (fileURL == null)
throw new WSException("Cannot resolve handler file '" + filename + "' on " + wsClass.getName());
log.debug("Loading handler chain: " + fileURL);
UnifiedHandlerChainsMetaData handlerChainsMetaData = null;
try
{
InputStream is = fileURL.openStream();
try
{
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
unmarshaller.setValidation(true);
unmarshaller.setSchemaValidation(true);
unmarshaller.setEntityResolver(new JBossWSEntityResolver());
ObjectModelFactory factory = new HandlerChainsObjectFactory();
handlerChainsMetaData = (UnifiedHandlerChainsMetaData)unmarshaller.unmarshal(is, factory, null);
}
finally
{
is.close();
}
}
catch (RuntimeException rte)
{
throw rte;
}
catch (Exception ex)
{
throw new WSException("Cannot process handler chain: " + filename, ex);
}
return handlerChainsMetaData;
}