Examples of VFSDeploymentUnit


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

      JBossEnterpriseBeansMetaData beans = deployment.getEnterpriseBeans();
      Iterator<JBossEnterpriseBeanMetaData> beansIter = beans.iterator();
      HashSet<String> invokerNames = new HashSet<String>();
      HashSet<String> beanDepends = new HashSet<String>();
      // Process ContainerDependencyMetaData
      VFSDeploymentUnit topUnit = unit.getTopLevel();
      Map<String, ContainerDependencyMetaData> endpoints = (Map<String, ContainerDependencyMetaData>) topUnit.getAttachment(MappedReferenceMetaDataResolverDeployer.ENDPOINT_MAP_KEY);
      if(endpoints == null)
         log.warn(unit+" has no ContainerDependencyMetaData attachment");
      String vfsPath = unit.getRelativePath();
      ArrayList<BeanMetaData> mcBeanMD = new ArrayList<BeanMetaData>();
      while( beansIter.hasNext() )
View Full Code Here

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

      if( name == null )
      {
         StringBuilder objectName = new StringBuilder(EjbModule.BASE_EJB_MODULE_NAME);
         // Get the top level unit for this unit (ex: the top level might be an ear and this unit might be the jar
         // in that ear
         VFSDeploymentUnit toplevelUnit = unit.getTopLevel();
         if (toplevelUnit != null)
         {
            // if top level is an ear, then create the name with the ear reference
            if (isEar(toplevelUnit))
            {
              
               String earName = ObjectName.quote(toplevelUnit.getSimpleName());
               objectName.append(",ear=");
               objectName.append(earName);
            }
         }
        
View Full Code Here

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

   private final List<Closeable> vfsHandles = new ArrayList<Closeable>();
  
   protected VFSDeploymentUnit assertDeploy(Archive<?> archive) throws Exception
   {
      VirtualFile virtualFile = mount(archive);
      VFSDeploymentUnit unit = assertDeploy(virtualFile);
      return unit;
   }
View Full Code Here

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

   }
  
   @Override
   protected VFSDeploymentUnit assertDeploy(VirtualFile virtualFile) throws Exception
   {
      VFSDeploymentUnit unit = super.assertDeploy(virtualFile);
      units.add(unit);
      return unit;
   }
View Full Code Here

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

            if (local)
            {
               DeploymentUnit localUnit = deploymentUnitLocal.get();
               if (localUnit instanceof VFSDeploymentUnit)
               {
                  VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)localUnit;
                  VirtualFile vf = vfsUnit.getFile(resourceName);
                  if (vf != null)
                     is = vf.openStream();
               }
            }
View Full Code Here

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

   }

   public void testSimpleUsage() throws Exception
   {
      VirtualFile ear = createBasicEar();
      VFSDeploymentUnit topUnit = assertDeploy(ear);
      try
      {
         WeldDiscoveryEnvironment wbDiscovery = topUnit.getAttachment(WeldDiscoveryEnvironment.class);
         assertNotNull("Null WBDiscoveryEnv.", wbDiscovery);

         Set<String> expected = new HashSet<String>();
         addExpectedResource(expected, "ejbs.jar");
         addExpectedResource(expected, "ext.jar");
View Full Code Here

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

   public void deploy(DeploymentUnit unit) throws DeploymentException
   {
      if (unit instanceof VFSDeploymentUnit == false)
         return;
     
      VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit;
      deploy(vfsDeploymentUnit);
   }
View Full Code Here

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

      this.log.debug("Creating new WS deployment model for: " + unit);
      final ArchiveDeployment dep = this.newDeployment(unit.getSimpleName(), unit.getClassLoader());

      if (unit instanceof VFSDeploymentUnit)
      {
         final VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit) unit;
         final List<VirtualFile> virtualFiles = vfsUnit.getMetaDataFiles(AbstractDeploymentModelBuilder.WS_FILE_FILTER);
         final Set<UnifiedVirtualFile> uVirtualFiles = new HashSet<UnifiedVirtualFile>();
         for (VirtualFile vf : virtualFiles)
         {
            // Adding the roots of the virtual files.
            uVirtualFiles.add(new VirtualFileAdaptor(vf))
View Full Code Here

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

      List<SessionFactoryMetaData> sessionFactoryMetaDatas = metaData.getSessionFactories();
      if (sessionFactoryMetaDatas == null || sessionFactoryMetaDatas.isEmpty())
         return;

      VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
      if (scanFromTop)
         vfsUnit = vfsUnit.getTopLevel();

      VirtualFile root = vfsUnit.getRoot();
      for (int i = 0; i < sessionFactoryMetaDatas.size(); i++)
      {
         // build the hibernate bean
         BeanMetaData beanMetaData = sessionFactoryMetaDatas.get(i).getBeanMetaData(root);
         vfsUnit.addAttachment(BeanMetaData.class + "$Hibernate#" + (i + 1), beanMetaData);
         log.debug("Created Hibernate bean: " + beanMetaData);
      }
   }
View Full Code Here

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

         if (unit instanceof VFSDeploymentUnit)
         {
            URL expWarUrl;

            VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
            VirtualFile root = vfsUnit.getRoot();
            expWarUrl = getExplodedWarUrl(root);

            // Map
            String warPathName = root.getPathName();
            if (warPathName.endsWith("/") == false)
               warPathName += "/";
            List<VirtualFile> classpathVFs = vfsUnit.getClassPath();
            if (classpathVFs != null)
            {
               List<URL> classpath = new ArrayList<URL>();
               for (VirtualFile vf : classpathVFs)
               {
                  try
                  {
                     String path = vf.getPathName();
                     if (path.startsWith(warPathName))
                     {
                        path = path.substring(warPathName.length());
                        URL pathURL = new URL(expWarUrl, path);
                        classpath.add(pathURL);
                     }
                     else
                     {
                        log.debug("Ignoring path element: " + vf);
                     }
                  }
                  catch (Exception e)
                  {
                     log.debug("Ignoring path element: " + vf, e);
                  }
               }
               unit.addAttachment("org.jboss.web.expandedWarClasspath", classpath);
            }

            // Indicate that an expanded URL exists
            unit.addAttachment("org.jboss.web.expandedWarURL", expWarUrl, URL.class);

            // Resolve any ear relative alt-dd path to an expWarUrl/WEB-INF/alt-dd.xml file
            String altDDPath = metaData.getAlternativeDD();
            if (altDDPath != null)
            {
               // First see if this is already a war local dd
               VirtualFile altDD = vfsUnit.getMetaDataFile(altDDPath);
               if (altDD == null)
               {
                  // Pass absolute paths through
                  File file = new File(altDDPath);
                  if (!file.exists() || !file.isAbsolute())
                  {
                     // Should be an relative to the top deployment
                     VFSDeploymentUnit topUnit = vfsUnit.getTopLevel();
                     if (topUnit == unit)
                        throw new DeploymentException("Unable to resolve " + altDDPath + " as WEB-INF path");
                     altDD = topUnit.getFile(altDDPath);
                     if (altDD == null)
                        throw new DeploymentException("Unable to resolve " + altDDPath + " as a deployment path");
                    
                     VirtualFile altDDFile = root.getChild("WEB-INF/" + altDD.getName());
                     log.debug("Copying the altDD to: " + altDDFile);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.