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

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


     
      try
      {
         if (hasCp || hasWB)
         {
            VFSDeploymentUnit moduleUnit = unit;
            Module module = moduleUnit.getAttachment(Module.class);
            while (moduleUnit != null && module == null)
            {
               moduleUnit = moduleUnit.getParent();
               module = moduleUnit.getAttachment(Module.class);
            }
            if (module == null)
               throw new DeploymentException("No module in deployment unit's hierarchy: " + unit.getName());

            ArchiveInfo archive = moduleUnit.getAttachment(ArchiveInfo.class);
            if (archive == null)
               throw new IllegalStateException("Archive attachment expected for unit " + unit);

            WeldDiscoveryEnvironment environment = archive.getEnvironment();
            if (hasCp)
View Full Code Here


      boolean hasCp = (cpFiles != null && cpFiles.isEmpty() == false);

      WeldDiscoveryEnvironment environment = null;
      if (hasWB || hasCp)
      {
         VFSDeploymentUnit topUnit = unit.getTopLevel();
         environment = topUnit.getAttachment(WeldDiscoveryEnvironment.class);
         if (environment == null)
         {
            environment = new WeldDiscoveryEnvironment();
            topUnit.addAttachment(WeldDiscoveryEnvironment.class, environment);
         }
      }

      try
      {
         if (hasWB)
         {
            for (VirtualFile file : wbFiles)
               environment.addWeldXmlURL(file.toURL());
         }

         if (hasCp)
         {
            Module module = unit.getAttachment(Module.class);
            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 DeploymentException("No module in deployment unit's hierarchy: " + unit.getName());
            }
View Full Code Here

         }
           
         log.debug("********* " + this.getClass().getSimpleName() + " Begin Unit: " + unit.getSimpleName() + " jar: "
               + jar.getName());
         JBoss5DeploymentScope scope = null;
         VFSDeploymentUnit parent = unit.getTopLevel();
         boolean initScopeDeployment = false;
         if (parent != null)
         {
            // Check for an existing scope
            scope = (JBoss5DeploymentScope) parent.getAttachment(DeploymentScope.class);
            if (scope == null)
            {
               // Check for a scoped deployment or an ear top-level unit
               boolean isEar = unit != unit.getTopLevel() || parent.isAttachmentPresent(JBossAppMetaData.class);
               if(parent.isAttachmentPresent(DeploymentEndpointResolver.class) == true)
                  scope = new JBoss5DeploymentScope(parent, isEar);
               else
               {
                  // EJBTHREE-1291
                  scope = new JBoss5DeploymentScope(parent, isEar, unit.getSimpleName());
                  initScopeDeployment = true;
               }
               parent.addAttachment(DeploymentScope.class, scope);
            }
         }

         JBoss5DeploymentUnit du = new JBoss5DeploymentUnit(unit);
         Ejb3JBoss5Deployment deployment = new Ejb3JBoss5Deployment(du, kernel, mbeanServer, unit, scope, metaData);
View Full Code Here

         {
            String uri = vf.toURI().toString();
            cpURIs.add(uri);
         }
         // Also need to include the ear lib dir entries
         VFSDeploymentUnit earUnit = unit.getParent();
         if(earUnit != null)
         {
            JBossAppMetaData earMD = earUnit.getAttachment(JBossAppMetaData.class);
            if(earMD != null)
            {
               // find the lib dir of the ear
               String libDir = earMD.getLibraryDirectory();
               // if not explicitly specified, then set the default as "lib" folder in .ear
               if (libDir == null || libDir.length() == 0)
               {
                  libDir = "lib";
               }
               // get the root of the ear
               VirtualFile earRoot = earUnit.getRoot();
               // get the VirtualFile corresponding to .ear/libdirectory (if any)
               VirtualFile earLib = earRoot.getChild(libDir);
               // ear library dir was found, so add all it's children to the classpath
               if (earLib != null)
               {
View Full Code Here

            return;
         }
           
         log.debug("********* EJBRegistrationDepoyer Begin Unit: " + unit.getSimpleName() + " jar: " + jar.getName());
         JBoss5DeploymentScope scope = null;
         VFSDeploymentUnit parent = unit.getParent();
         boolean initScopeDeployment = false;
         if (parent != null && parent.isAttachmentPresent(JBossAppMetaData.class))
         {
            // An ear parent
            scope = (JBoss5DeploymentScope) parent.getAttachment(DeploymentScope.class);
            if (scope == null)
            {
               boolean isEar = unit != unit.getTopLevel();
               if(parent.isAttachmentPresent(DeploymentEndpointResolver.class) == true)
                  scope = new JBoss5DeploymentScope(parent, isEar);
               else
               {
                  // EJBTHREE-1291
                  scope = new JBoss5DeploymentScope(parent, isEar, unit.getSimpleName());
                  initScopeDeployment = true;
               }
               parent.addAttachment(DeploymentScope.class, scope);
            }
         }
         JBoss5DeploymentUnit du = new JBoss5DeploymentUnit(unit);
         du.setDefaultPersistenceProperties(defaultPersistenceProperties);
         Ejb3JBoss5Deployment deployment = new Ejb3JBoss5Deployment(du, kernel, mbeanServer, unit, scope, null);
View Full Code Here

      JBossRAMetaData jrmd = getInstance(metadata, JBossRAMetaData.class);
      if (jrmd != null)
         deployment.setRaXmlMetaData(jrmd);

      VFSDeploymentUnit parent = unit.getParent();
      String name = unit.getSimpleName();
      if (parent != null)
         name = parent.getSimpleName() + "#" + name;

      VirtualFile file = unit.getMetaDataFile(jeeSpecRarDD);
      deployment.getConnectorMetaData().setURL(file.toURL());
      metaDataRepository.addConnectorMetaData(name, deployment.getConnectorMetaData());
View Full Code Here

       */
      @SuppressWarnings("unchecked")
      List<URL> classpath = unit.getAttachment("org.jboss.web.expandedWarClasspath", List.class);
      if (classpath == null && unit instanceof VFSDeploymentUnit)
      {
         VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
         try
         {
            VirtualFile classes = vfsUnit.getFile("WEB-INF/classes");
            // Tomcat can't handle the vfs urls yet
            URL vfsURL = classes.toURL();
            String vfsurl = vfsURL.toString();
            if (vfsurl.startsWith("vfs"))
               vfsURL = new URL(vfsurl.substring(3));
View Full Code Here

   public void deploy(DeploymentUnit unit) throws DeploymentException
   {
      if (unit instanceof VFSDeploymentUnit == false)
         return;

      VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit;
      deploy(vfsDeploymentUnit);
   }
View Full Code Here

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

      {
         log.tracef("Unit name does not end in .ear: %1s", unit.getSimpleName());
         return;
      }

      VFSDeploymentUnit vfsunit = VFSDeploymentUnit.class.cast(unit);
      deploy(vfsunit);
   }
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.