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

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


            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


     
      // Locate the parent class path
      List<VirtualFile> parentClassPath = null;
      Set<VirtualFile> parentExcludes = null;

      VFSDeploymentUnit parent = unit.getParent();
      while (parent != null)
      {
         parentClassPath = parent.getAttachment(VFS_CLASS_PATH, List.class);
         if (parentClassPath != null)
         {
            parentExcludes = parent.getAttachment(VFS_EXCLUDES, Set.class);
            break;
         }
         else
            parent = parent.getParent();
      }
     
      // Get our classpath
      ClassPathVisitor visitor = new ClassPathVisitor(unit);
      unit.visit(visitor);
View Full Code Here

         if (unit instanceof VFSDeploymentUnit)
         {
            URL expWarUrl;

            VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
            VirtualFile root = vfsUnit.getRoot();
            VirtualFile unjared = VFSUtils.unjar(root);
            // file was not unjared yet
            if (root != unjared)
            {
               // get the real unjared url
               expWarUrl = VFSUtils.getRealURL(unjared);

               // 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);
               // add exploded VirtualFile directly
               unit.addAttachment("org.jboss.web.expandedWarFile", unjared, VirtualFile.class);
            }
            else
            {
              expWarUrl = VFSUtils.getRealURL(root);
         }

            // 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");
                     File webInf = new File(expWarUrl.toURI());
                     File altDDFile = new File(webInf, "WEB-INF/" + altDD.getName());
                     log.debug("Copying the altDD to: " + altDDFile);
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

      if (requiresEarSuffix && unit.getSimpleName().endsWith(".ear") == false)
      {
         log.trace("Unit name does not end in .ear: " + unit.getSimpleName());
         return;
      }
      VFSDeploymentUnit vfsunit = VFSDeploymentUnit.class.cast(unit);
      /* If there is a META-INF/application.xml we don't process this.
       * This is probably unnecessary?
       */
      VirtualFile appXml = vfsunit.getMetaDataFile("application.xml");
      if( appXml != null )
      {
         log.trace("Ignoring ear with META-INF/application.xml: " + unit.getSimpleName());
         return;
      }
View Full Code Here

         // Get the war URL
         URL warUrl = unit.getAttachment("org.jboss.web.expandedWarURL", URL.class);
         if (warUrl == null && unit instanceof VFSDeploymentUnit)
         {
            VFSDeploymentUnit vdu = VFSDeploymentUnit.class.cast(unit);
            warUrl = VFSUtils.getRealURL(vdu.getRoot());
         }

         // Dynamic WebMetaData deployments might not provide an URL
         // We use the DEploymentUnit name as identifier instead.
         // The JAXWS Endpoint API for example does this.
View Full Code Here

   private void linkServiceRefs(DeploymentUnit unit, ServiceReferencesMetaData serviceRefs, Context envCtx) throws NamingException
   {
      if (unit instanceof VFSDeploymentUnit)
      {
         VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
         ClassLoader loader = unit.getClassLoader();
         UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(vfsUnit.getRoot());
         for (ServiceReferenceMetaData sref : serviceRefs)
         {
            String refName = sref.getServiceRefName();
            new ServiceReferenceHandler().bindServiceRef(envCtx, refName, vfsRoot, loader, sref);
         }
View Full Code Here

   {
      if (ignoreName(unit, name))
         return null;

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

      VirtualFile file = getMetadataFile(vfsDeploymentUnit, getOutput(), name, true);
      return (file != null) ? parseAndInit(vfsDeploymentUnit, file, root) : null;
   }
View Full Code Here

   protected T parse(DeploymentUnit unit, Set<String> names, 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>();
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.