1 22 package org.jboss.deployment; 23 24 import java.net.URL ; 25 26 import org.jboss.xb.binding.Unmarshaller; 27 import org.jboss.xb.binding.UnmarshallerFactory; 28 import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; 29 import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory; 30 31 38 public abstract class SchemaResolverSimpleSubDeployerSupport extends SimpleSubDeployerSupport 39 { 40 41 private UnmarshallerFactory factory = UnmarshallerFactory.newInstance(); 42 43 44 private SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver(); 45 46 protected void parseMetaData(DeploymentInfo di, URL url) throws DeploymentException 47 { 48 try 49 { 50 Unmarshaller unmarshaller = factory.newUnmarshaller(); 51 di.metaData = unmarshaller.unmarshal(url.toString(), resolver); 52 if (di.metaData == null) 53 throw new RuntimeException ("The xml " + url + " is not well formed!"); 54 } 55 catch (Throwable t) 56 { 57 DeploymentException.rethrowAsDeploymentException("Error parsing meta data " + url, t); 58 } 59 } 60 } 61 | Popular Tags |