Package org.jboss.xb.binding

Examples of org.jboss.xb.binding.Unmarshaller


         VirtualFile jbossAppXml = getMetaDataFile(file, "META-INF/jboss-app.xml");
         VirtualFile lib;

         boolean scan = true;

         Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller();
         unmarshaller.setValidation(useValidation);
         EarMetaData specMetaData = null;
         JBossAppMetaData appMetaData = null;
         if (applicationXml != null)
         {
            InputStream in = applicationXml.openStream();
            try
            {
               specMetaData = (EarMetaData) unmarshaller.unmarshal(in, resolver);
            }
            finally
            {
               in.close();
            }
            scan = false;
         }
         if (jbossAppXml != null)
         {
            InputStream in = jbossAppXml.openStream();
            try
            {
               appMetaData = (JBossAppMetaData) unmarshaller.unmarshal(in, resolver);
            }
            finally
            {
               in.close();
            }
View Full Code Here


      synchronized (this)
      {
         if (sharedTldMetaData == null && tldJars != null)
         {
            UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
            Unmarshaller unmarshaller = factory.newUnmarshaller();
            SchemaBindingResolver resolver = SingletonSchemaResolverFactory
                  .getInstance().getSchemaBindingResolver();

            // Parse shared JARs for TLDs
            sharedTldMetaData = new ArrayList<TldMetaData>();
            if (tldJars != null)
            {
               VirtualFileFilter tldFilter = new SuffixMatchFilter(".tld", VisitorAttributes.DEFAULT);
               for (URL tldJar : tldJars)
               {
                  try
                  {
                     VirtualFile virtualFile = VFS.getChild(tldJar);
                     VirtualFile metaInf = virtualFile.getChild("META-INF");
                     if (metaInf != null)
                     {
                        List<VirtualFile> tlds = metaInf.getChildren(tldFilter);
                        for (VirtualFile tld : tlds)
                        {
                           TldMetaData tldMetaData = (TldMetaData) unmarshaller.unmarshal(tld.toURL().toString(), resolver);
                           sharedTldMetaData.add(tldMetaData);
                        }
                     }
                  }
                  catch (Exception e)
View Full Code Here

      {
         if ((sharedWebMetaData == null && webXml != null)
               || (sharedJBossWebMetaData == null && jbossWebXml != null))
         {
            UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
            Unmarshaller unmarshaller = factory.newUnmarshaller();
            SchemaBindingResolver resolver = SingletonSchemaResolverFactory
                  .getInstance().getSchemaBindingResolver();
            if (webXml != null)
            {
               try
               {
                  sharedWebMetaData = (WebMetaData) unmarshaller.unmarshal(webXml, resolver);
               }
               catch (JBossXBException e)
               {
                  throw new DeploymentException("Error parsing shared web.xml", e);
               }
            }
            if (jbossWebXml != null)
            {
               try
               {
                  sharedJBossWebMetaData = (JBossWebMetaData) unmarshaller.unmarshal(jbossWebXml, resolver);
               }
               catch (JBossXBException e)
               {
                  throw new DeploymentException("Error parsing shared jboss-web.xml", e);
               }
View Full Code Here

         return this.ddParser.parse(file.toURL());
      }
      else if (this.ddProcessor != null)
      {
         InputSource source = new VFSInputSource(file);
         Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
         unmarshaller.setValidation(this.ddProcessor.isValidating());
         ObjectModelFactory factory = this.ddProcessor.getFactory(file.toURL());
         return (T)unmarshaller.unmarshal(source, factory, root);
      }

      return null;
   }
View Full Code Here

   {
      SecurityConfigObjectModelFactory lcomf = new SecurityConfigObjectModelFactory();
      UsersObjectModelFactory uomf = new UsersObjectModelFactory();
     
      InputStreamReader xmlReader = new InputStreamReader(loginConfigURL.openStream());
      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      unmarshaller.mapFactoryToNamespace(uomf, "http://www.jboss.org/j2ee/schemas/XMLLoginModule");
      policyConfig = (PolicyConfig) unmarshaller.unmarshal(xmlReader, lcomf, (Object)null);
   }
View Full Code Here

      ObjectName objectName = new ObjectName(objectNameS);

      // Parse main server.xml
      // FIXME: this could be done somewhere else
      SchemaBinding schema = JBossXBBuilder.build(ServerMetaData.class);
      Unmarshaller u = UnmarshallerFactory.newInstance().newUnmarshaller();
      u.setSchemaValidation(false);
      u.setValidation(false);
      u.setEntityResolver(new JBossEntityResolver());
      InputStream is = null;
      ServerMetaData serverMetaData = null;
      try {
         File configFile = new File(tomcatDeployer.getConfigFile());
         if (configFile.exists())
         {
            is = new FileInputStream(configFile);
         }
         else
         {
            is = getClass().getClassLoader().getResourceAsStream(tomcatDeployer.getConfigFile());
         }
         if (is == null) {
            log.error("Could not read configured server.xml (will try default): " + tomcatDeployer.getConfigFile());
            is = getClass().getClassLoader().getResourceAsStream("server.xml");
         }
         serverMetaData = ServerMetaData.class.cast(u.unmarshal(is, schema));
      } finally {
         if (is != null) {
            try {
               is.close();
            } catch (IOException e) {
View Full Code Here

   }
  
  
   protected KernelDeployment parse(String name) throws Throwable
   {
      Unmarshaller unmarshaller = factory.newUnmarshaller();
      KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(name, resolver);
      deployment.setName(name);
      return deployment;
   }
View Full Code Here

      if (trace)
         log.trace("Parsing " + url);

      long start = System.currentTimeMillis();
     
      final Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(url.toString(), schemaBinding);
      if (deployment == null)
         throw new RuntimeException("The xml " + url + " is not well formed!");
      deployment.setName(url.toString());
     
      long now = System.currentTimeMillis();
View Full Code Here

   {
      boolean trace = log.isTraceEnabled();

      if (trace)
         log.trace("Parsing " + deploymentName);
      final Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
      KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(stream, schemaBinding);
      if (deployment == null)
         throw new RuntimeException("The deployment " + deploymentName + " is not well formed!");
      deployment.setName(deploymentName);

      if (trace)
View Full Code Here

                  if (trace)
                     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, structureContext.getMetaData());
                  isJBossStructure = true;
               }
            }
            catch (IOException e)
            {
View Full Code Here

TOP

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

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.