Package org.jboss.deployers.vfs.spi.structure

Examples of org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit


      // The infrastructure will only check leafs anyway so no need to check here
      if (name == null && isIncludeDeploymentFile())
         name = unit.getName();

      // Try to find the metadata
      VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit;

      // let's check altDD first
      VirtualFile file = getMetadataFile(vfsDeploymentUnit, getOutput(), name, false);
      if (file != null)
         return parseAndInit(vfsDeploymentUnit, file, root, true);

      // try all name+suffix matches
      List<VirtualFile> files = vfsDeploymentUnit.getMetaDataFiles(name, suffix, getMetaDataTypeFilter(unit));
      switch (files.size())
      {
         case 0 :
            return null;
         case 1 :
View Full Code Here


   protected T parse(DeploymentUnit unit, Set<String> names, String suffix, T root) throws Exception
   {
      if (names == null || names.isEmpty())
         throw new IllegalArgumentException("Null or empty names.");

      VFSDeploymentUnit  vfsDeploymentUnit = (VFSDeploymentUnit)unit;

      List<VirtualFile> files = new ArrayList<VirtualFile>();
      Set<String> missingFiles = new HashSet<String>();
      Set<String> ignoredFiles = new HashSet<String>();

      for (String name : names)
      {
         if (ignoreName(unit, name))
         {
            ignoredFiles.add(name);
         }
         else
         {
            // try finding altDD file
            VirtualFile file = getMetadataFile(vfsDeploymentUnit, matchFileToClass(unit, name), name, false);
            if (file == null)
            {
               List<VirtualFile> matched = vfsDeploymentUnit.getMetaDataFiles(name, suffix, getMetaDataTypeFilter(unit));
               if (matched != null && matched.isEmpty() == false)
               {
                  for (VirtualFile m : matched)
                  {
                     if (ignoreFile(vfsDeploymentUnit, m))
View Full Code Here

   public void deploy(VFSDeploymentUnit unit, Module module) throws DeploymentException
   {
      if (module == null)
      {
         VFSDeploymentUnit parent = unit.getParent();
         while(parent != null && module == null)
         {
            module = parent.getAttachment(Module.class);
            parent = parent.getParent();
         }
         if (module == null)
            throw new IllegalArgumentException("No module in deployment unit's hierarchy: " + unit.getName());
      }
View Full Code Here

    }
   
    public static EsbMetaData getEsbMetaData(final EsbConfigParser parserDeployer, final URL dir, final String archiveName) throws Exception, DeploymentException
    {
        VirtualFile virtualFile = TestUtil.getVirtualFile(dir, archiveName, TestUtil.class);
        VFSDeploymentUnit deploymentUnit = getDeploymentUnit(dir, archiveName);
        return parserDeployer.parse(deploymentUnit, virtualFile, (EsbMetaData)null);
    }
View Full Code Here

   
    public void testExplodedEsbArchive() throws Throwable
    {
        final String archiveName = "exploded-esb-archive.esb";
        EsbMetaData esbMetaData = TestUtil.getEsbMetaData(new EsbConfigParser(), dir, archiveName);
        VFSDeploymentUnit deploymentUnit = TestUtil.getDeploymentUnit(dir, archiveName);
       
        esbDeployer.setWarFilesDir(System.getProperty("java.io.tmpdir"));
        esbDeployer.deploy(deploymentUnit, esbMetaData);
        Object attachment = deploymentUnit.getAttachment(BeanMetaData.class.getName() + "_ESB");
        assertTrue(attachment instanceof BeanMetaData);
       
        EsbDeployer esbDeployer = (EsbDeployer) getBean("EsbDeployer");
        List<String> defaultDependencies = esbDeployer.getDefaultDependencies();
        assertEquals(2, defaultDependencies.size());
View Full Code Here

        assertTrue(deps.contains(new ObjectName("jboss.esb:deployment=jbossesb.esb")));
    }
   
    public void testGetDependenciesFromDeploymentUnit() throws Exception
    {
        VFSDeploymentUnit unit = TestUtil.getDeploymentUnit(dir, "exploded-esb-archive.esb");
        Set<ObjectName> deps = parserDeployer.getDependenciesFromDeploymentXml(unit);
       
        assertFalse(deps.isEmpty());
        assertEquals(3, deps.size());
        assertTrue(deps.contains(new ObjectName("jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_Request_esb")));
View Full Code Here

    }
   
    public void testGetDependenciesFromDeploymentUnitNoDeps() throws Exception
    {
        VirtualFile vfs = VfsUtil.createInMemoryFs(VfsUtil.createInMemUrl("confParser"));
        VFSDeploymentUnit unit = TestUtil.getDeploymentUnit(vfs);
        Set<ObjectName> deps = parserDeployer.getDependenciesFromDeploymentXml(unit);
       
        assertTrue(deps.isEmpty());
    }
View Full Code Here

    }
   
    public void testDeploymentName() throws Exception
    {
        VirtualFile vfs = VfsUtil.createInMemoryFs(VfsUtil.createInMemUrl("confParser"));
        VFSDeploymentUnit unit = TestUtil.getDeploymentUnit(vfs);
       
        assertEquals("", parserDeployer.getDeploymentName(unit));
    }
View Full Code Here

        assertEquals("", parserDeployer.getDeploymentName(unit));
    }
   
    public void testGetDeploymentName() throws Exception
    {
        VFSDeploymentUnit unit = TestUtil.getDeploymentUnit(dir, "exploded-esb-archive.esb");
       
        assertEquals("exploded-esb-archive", parserDeployer.getDeploymentName(unit));
    }
View Full Code Here

      {
         DeploymentModelFactory factory = getDeploymentModelFactory();
         ArchiveDeployment dep = (ArchiveDeployment)factory.newDeployment(unit.getSimpleName(), unit.getClassLoader());
         if (unit instanceof VFSDeploymentUnit)
         {
            VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
            List<VirtualFile> virtualFiles = vfsUnit.getMetaDataFiles(WS_FILEFILTER); //get all wsdl and xsd files
            Set<UnifiedVirtualFile> uVirtualFiles = new HashSet<UnifiedVirtualFile>();
            for (VirtualFile vf : virtualFiles)
            {
               // Adding the roots of the virtual files.
               uVirtualFiles.add(new VirtualFileAdaptor(vf.getVFS().getRoot()));
View Full Code Here

TOP

Related Classes of org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit

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.