Package org.jboss.xb.binding

Examples of org.jboss.xb.binding.UnmarshallerFactory


   public static KernelDeployment parse(File fp)
           throws JBossXBException, MalformedURLException
   {
      long start = System.currentTimeMillis();
      SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
      UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
      Unmarshaller unmarshaller = factory.newUnmarshaller();
      KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(fp.toURL().toString(), resolver);
      long end = System.currentTimeMillis() - start;
      System.out.println("XML parsing took: " + end);
      return deployment;
   }
View Full Code Here


   }

   public static KernelDeployment parse(URL url) throws JBossXBException, MalformedURLException
   {
      SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
      UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
      Unmarshaller unmarshaller = factory.newUnmarshaller();
      return (KernelDeployment) unmarshaller.unmarshal(url.toString(), resolver);
   }
View Full Code Here

   public static KernelDeployment parse(File fp)
           throws JBossXBException, MalformedURLException
   {
      SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
      long start = System.currentTimeMillis();
      UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
      Unmarshaller unmarshaller = factory.newUnmarshaller();
      KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(fp.toURL().toString(), resolver);
      long end = System.currentTimeMillis() - start;
      System.out.println("XML parsing took: " + end);
      return deployment;
   }
View Full Code Here

   }
  
   public EjbJar21MetaData getEJBMetaData(InputStream ejbJarXml)
      throws JBossXBException
   {
      UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
      SchemaBinding schema = JBossXBBuilder.build(EjbJar21MetaData.class);
      JBossEntityResolver entityResolver = new JBossEntityResolver();
      unmarshaller.setEntityResolver(entityResolver);

      return (EjbJar21MetaData) unmarshaller.unmarshal(ejbJarXml, schema);
View Full Code Here

   }
  
   public WebMetaData getWebMetaData(InputStream webxml)
      throws JBossXBException
   {
      UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
      SchemaBinding schema = JBossXBBuilder.build(Web24MetaData.class);
      JBossEntityResolver entityResolver = new JBossEntityResolver();
      unmarshaller.setEntityResolver(entityResolver);

      return (WebMetaData) unmarshaller.unmarshal(webxml, schema);
View Full Code Here

   }

   private List<BeanMetaDataFactory> loadBeanMetaDataFactories() throws Exception
   {
      SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
      UnmarshallerFactory factory = UnmarshallerFactory.newInstance();

      Unmarshaller unmarshaller = factory.newUnmarshaller();
      URL url = getClass().getResource(getFileName());
      KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(url.toString(), resolver);
      return deployment.getBeanFactories();
   }
View Full Code Here

   }
  
   protected ConnectorMetaData getConnectorMetaData() throws Exception
  
      ObjectModelFactory factory = new ResourceAdapterObjectModelFactory();
      UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
     
      URL rar = Thread.currentThread().getContextClassLoader().getResource(rarName);
      JarFile rarFile = new JarFile(rar.getFile());
      ZipEntry entry = rarFile.getEntry("META-INF/ra.xml");
     
View Full Code Here

            try
            {
               VirtualFile jbossStructure = file.findChild("META-INF/jboss-structure.xml");
               log.trace("... context has a META-INF/jboss-structure.xml");
               URL url = jbossStructure.toURL();
               UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
               Unmarshaller unmarshaller = factory.newUnmarshaller();
               StructureMetaDataObjectFactory ofactory = new StructureMetaDataObjectFactory();
               unmarshaller.unmarshal(url.toString(), ofactory, metaData);
               isJBossStructure = true;
            }
            catch (IOException e)
View Full Code Here

    */
   public ConnectorMetaData getStandardMetaData(File root) throws Exception
   {
      ConnectorMetaData result = null;

      UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();

      MutableSchemaResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
      resolver.mapLocationToClass("connector_1_6.xsd", JCA16MetaData.class);
      resolver.mapLocationToClass("connector_1_5.xsd", JCA15MetaData.class);
      resolver.mapLocationToClass("connector_1_5.dtd", JCA15DTDMetaData.class);
View Full Code Here

    */
   public JBossRAMetaData getJBossMetaData(File root) throws Exception
   {
      JBossRAMetaData result = null;

      UnmarshallerFactory unmarshallerFactory = UnmarshallerFactory.newInstance();
      Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();

      MutableSchemaResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
      resolver.mapLocationToClass("http://www.jboss.org/schema/jboss-ra_1_0.xsd", JBossRA10MetaData.class);
      resolver.mapLocationToClass("http://www.jboss.org/schema/jboss-ra_2_0.xsd", JBossRA20MetaData.class);
      resolver.mapLocationToClass("jboss-ra", JBossRA20DefaultNSMetaData.class);
View Full Code Here

TOP

Related Classes of org.jboss.xb.binding.UnmarshallerFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.