ContextMetaData contextMetaData = null;
try
{
SchemaBinding schema = JBossXBBuilder.build(ContextMetaData.class);
Unmarshaller u = UnmarshallerFactory.newInstance().newUnmarshaller();
u.setSchemaValidation(false);
u.setValidation(false);
u.setEntityResolver(new JBossEntityResolver());
InputStream is = null;
try
{
if (local)
{
DeploymentUnit localUnit = deploymentUnitLocal.get();
if (localUnit instanceof VFSDeploymentUnit)
{
VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)localUnit;
VirtualFile vf = vfsUnit.getFile(resourceName);
if (vf != null)
is = vf.openStream();
}
}
if (is == null)
is = getClass().getClassLoader().getResourceAsStream(resourceName);
if (is != null)
contextMetaData = ContextMetaData.class.cast(u.unmarshal(is, schema));
}
finally
{
if (is != null)
{