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

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


      assertNoMetaDataMatch(context, null, "-ds.xml");
   }

   public void testNotPartialMatchNoMetaInf() throws Exception
   {
      VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata-nometainf.jar");
      context.setMetaDataPath(Collections.singletonList("META-INF"));
      assertNoMetaDataMatch(context, null, "-not.xml");
   }
View Full Code Here


      assertNoMetaDataMatch(context, null, "-not.xml");
   }

   public void testExactAndPartialMatchMetaInf() throws Exception
   {
      VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata.jar");
      context.setMetaDataPath(Collections.singletonList("META-INF"));
      Set<String> expected = new HashSet<String>();
      expected.add(getVfsURL("/metadata/toplevel/metadata.jar/META-INF/jboss-service.xml"));
      expected.add(getVfsURL("/metadata/toplevel/metadata.jar/META-INF/1-ds.xml"));
      expected.add(getVfsURL("/metadata/toplevel/metadata.jar/META-INF/2-ds.xml"));
      assertMetaDataMatch(context, expected, "jboss-service.xml", "-ds.xml");
View Full Code Here

      assertMetaDataMatch(context, expected, "jboss-service.xml", "-ds.xml");
   }

   public void testNotExactAndPartialMatchMetaInf() throws Exception
   {
      VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata.jar");
      context.setMetaDataPath(Collections.singletonList("META-INF"));
      assertNoMetaDataMatch(context, "not-correct.xml", "-not.xml");
   }
View Full Code Here

      assertNoMetaDataMatch(context, "not-correct.xml", "-not.xml");
   }

   public void testExactAndPartialMatchNoMetaInf() throws Exception
   {
      VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata-nometainf.jar");
      context.setMetaDataPath(Collections.singletonList("META-INF"));
      assertNoMetaDataMatch(context, "jboss-service.xml", "-ds.xml");
   }
View Full Code Here

      assertNoMetaDataMatch(context, "jboss-service.xml", "-ds.xml");
   }

   public void testNotExactAndPartialMatchNoMetaInf() throws Exception
   {
      VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata-nometainf.jar");
      context.setMetaDataPath(Collections.singletonList("META-INF"));
      assertNoMetaDataMatch(context, "jboss-service.xml", "-not.xml");
   }
View Full Code Here

      assertNoMetaDataMatch(context, "jboss-service.xml", "-not.xml");
   }
  
   public void testRecurseInMetaInf() throws Exception
   {
      VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata-recurseinmetainf.jar");
      context.setMetaDataPath(Collections.singletonList("META-INF"));
      VirtualFileFilter filter = new ServicesFilter();
      Set<String> expected = new HashSet<String>();
      expected.add(getVfsURL("/metadata/toplevel/metadata-recurseinmetainf.jar/META-INF/jboss-service.xml"));
      expected.add(getVfsURL("/metadata/toplevel/metadata-recurseinmetainf.jar/META-INF/services/wsdl.xml"));
      assertMetaDataMatch(context, expected, filter);
View Full Code Here

      SchemaResolverDeployer<AbstractScanningMetaData> deployer = new ScanningMetaDataDeployer();
      deployer.create();
      try
      {
         VirtualFile file = getVirtualFile("/scanning", "smoke");
         VFSDeploymentContext deployment = new AbstractVFSDeploymentContext(file, "");
         deployment.setMetaDataPath(Collections.singletonList("META-INF"));
         VFSDeploymentUnit unit = new AbstractVFSDeploymentUnit(deployment);
         deployer.deploy(unit);
         try
         {
            ScanningMetaData metaData = unit.getAttachment(ScanningMetaData.class);
View Full Code Here

      saveAttachment(ctx, comp, false);
   }
  
   public void saveAttachment(String deploymentName, ManagedComponent component, boolean remove) throws Exception
   {
      VFSDeploymentContext ctx = getDeploymentContext(deploymentName);
      if(ctx == null)
         throw new IllegalStateException("Cannot persist attachment, failed to find deployment: " + deploymentName);

      // Get the root
      VirtualFile root = ctx.getRoot();
      String deploymentPath = createRelativeDeploymentPath(root);
     
      // Load previous saved information
      RepositoryAttachmentMetaData repositoryMetaData = loadAttachmentMetaData(deploymentPath);
      if(repositoryMetaData == null)
View Full Code Here

   protected DeploymentContext createChildDeploymentContext(DeploymentContext parent, ContextInfo child) throws Exception
   {
      if (parent instanceof VFSDeploymentContext)
      {
         VFSDeploymentContext vfsParent = (VFSDeploymentContext) parent;
         String path = child.getPath();
         try
         {
            VirtualFile parentFile = vfsParent.getRoot();
            VirtualFile file = parentFile.findChild(path);
            return new AbstractVFSDeploymentContext(file, path);
         }
         catch (Throwable t)
         {
            throw DeploymentException.rethrowAsDeploymentException("Unable to determine child " + path + " from parent " + vfsParent.getRoot().getName(), t);
         }
      }
      return super.createChildDeploymentContext(parent, child);
   }
View Full Code Here

      if (context instanceof VFSDeploymentContext)
      {
         boolean trace = log.isTraceEnabled();
         log.trace("Apply context: " + context.getName() + " " + contextInfo);
        
         VFSDeploymentContext vfsContext = (VFSDeploymentContext) context;
         String metaDataPath = contextInfo.getMetaDataPath();
         if (metaDataPath != null)
            vfsContext.setMetaDataPath(contextInfo.getMetaDataPath());
        
         boolean classPathHadVF = false;

         List<ClassPathEntry> classPathEntries = contextInfo.getClassPath();
         VFSDeploymentContext top = vfsContext.getTopLevel();
         VirtualFile root = top.getRoot();
         List<VirtualFile> classPath = new ArrayList<VirtualFile>();

         if (classPathEntries != null)
         {
            for (ClassPathEntry entry : classPathEntries)
View Full Code Here

TOP

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

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.