private static final Logger log = Logger.getLogger(EjbJarDDObjectFactory.class);
public static EjbJarDD parse(URL ddResource) throws JBossXBException, IOException
{
ObjectModelFactory factory = null;
Unmarshaller unmarshaller = null;
EjbJarDD dd = null;
if (ddResource != null)
{
log.debug("found ejb-jar.xml " + ddResource);
factory = new EjbJarDDObjectFactory();
UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
unmarshaller = unmarshallerFactory.newUnmarshaller();
unmarshaller.setEntityResolver(new JBossEntityResolver());
unmarshaller.setNamespaceAware(true);
unmarshaller.setSchemaValidation(true);
unmarshaller.setValidation(true);
dd = (EjbJarDD)unmarshaller.unmarshal(ddResource.openStream(), factory, null);
}
return dd;
}