Package org.jboss.vfs

Examples of org.jboss.vfs.VirtualFile


      repository.loadClass("org.jboss.seam.debug.Contexts");
   }

   public void testVFSPolicy() throws Exception
   {
      VirtualFile vf = getRoot();
      VirtualFile childWar = vf.getChild("jboss-seam-booking.war");
      VirtualFile child = childWar.getChild("/WEB-INF/lib/jboss-seam-debug.jar");
      assertTrue(child.exists());
      VirtualFile[] roots = {child};
      ClassLoaderPolicy policy = new VFSClassLoaderPolicy(roots);
      URL url = policy.getResource("org/jboss/seam/debug/Contexts.class");
      log.info(url);
      assertNotNull(url);
View Full Code Here


   }

   private static void mount(String path) throws IOException, URISyntaxException
   {
      URI root = new URI(path);
      VirtualFile file = VFS.getChild(root);

      mount(file);
   }
View Full Code Here

         return;
      }

      try
      {
         VirtualFile jar = unit.getRoot();
         if (jar.isLeaf() || ignoredJarsSet.contains(jar.getName()))
         {
            log.trace(this.getClass().getName() + " ignoring: " + jar.getName());
            return;
         }
         if(!hasAllowedSuffix(jar.getName()))
         {
            log.trace(this.getClass().getName() + " suffix not allowed: " + jar.getName());
            return;
         }
        
         // If DDs are required and none are present, skip deployment
         // EJBTHREE-1040
         if (this.isDeploymentDescriptorRequired() && (metaData == null))
         {
            log.trace(this.getClass().getSimpleName() + " skipping deployment \"" + unit.getSimpleName()
                  + "\", jar: \"" + jar.getName()
                  + "\" - either EJB3 Deployment Descriptor or \"jboss.xml\" is required and neither were found.");
            return;
         }
           
         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);
         if(initScopeDeployment)
         {
            scope.setDeployment(deployment);
         }
         deployment.setCacheFactoryRegistry(this.getCacheFactoryRegistry());
         // TODO: if the deployment becomes a proper MC bean, it'll get injected by MC.
         deployment.setMessageDestinationReferenceResolver(messageDestinationReferenceResolver);
         deployment.setPersistenceManagerFactoryRegistry(this.getPersistenceManagerFactoryRegistry());
         // TODO: if the deployment becomes a proper MC bean, it'll get injected by MC.
         deployment.setPersistenceUnitDependencyResolver(persistenceUnitDependencyResolver);
         deployment.setPoolFactoryRegistry(this.getPoolFactoryRegistry());
         if (scope != null)
            scope.register(deployment);
         // create() creates initial EJB containers and initializes metadata.
         deployment.create();
         if (deployment.getEjbContainers().size() == 0)
         {
            log.trace("Found no containers in scanned jar, consider adding it to the ignore list: " + jar.getName() + " url: " + jar.toURL() + " unit: " + unit.getSimpleName());
            deployment.destroy();
            return;
         }
         // We'll delay the start and let org.jboss.ejb3.deployers.Ejb3DeploymentDeployer start the deployment
         // deployment.start();
View Full Code Here

   }
  
   // TODO: integrate with Ejb3ClientDeployer.getMainClassName
   private String getMainClassName(VFSDeploymentUnit unit) throws IOException
   {
      VirtualFile file = unit.getMetaDataFile("MANIFEST.MF");
      log.trace("parsing " + file);

      if(file == null)
      {
         return null;
View Full Code Here

               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)
               {
                  List<VirtualFile> earLibContents = earLib.getChildren();
                  for (VirtualFile fileInEarLib : earLibContents)
                  {
                     String uri = fileInEarLib.toURI().toString();
                     cpURIs.add(uri);
                  }
View Full Code Here

   }

   // TODO: move this method either to a utility class or to the scanning deployer
   protected String getMainClassName(VFSDeploymentUnit unit, boolean fail) throws Exception
   {
      VirtualFile file = unit.getMetaDataFile("MANIFEST.MF");
      log.trace("parsing " + file);
      // Default to the jboss client main
      String mainClassName = "org.jboss.client.AppClientMain";

      if (file != null)
View Full Code Here

   URL extractDescriptorUrl(String resource)
   {
      try
      {
         VirtualFile vf = unit.getMetaDataFile(resource);
         if (vf == null) return null;
         return vf.toURL();
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

      {
         // Initialize
         boolean hasEjbDd = false;
         boolean hasJbossDd = false;
        
         VirtualFile jar = unit.getRoot();
         if (jar.isLeaf() || ignoredJarsSet.contains(jar.getName()))
         {
            log.trace("EJBRegistrationDeployer ignoring: " + jar.getName());
            return;
         }
         if(!hasAllowedSuffix(jar.getName()))
         {
            log.trace("EJBRegistrationDeployer suffix not allowed: " + jar.getName());
            return;
         }
        
         VirtualFile ejbjar = unit.getMetaDataFile("ejb-jar.xml");
         if (ejbjar != null)
         {
            InputStream is = ejbjar.openStream();
            boolean has30EjbJarXml = has30EjbJarXml(is);
            is.close();
            if (!has30EjbJarXml) {
               return;
            }
View Full Code Here

   // ----------------------------------------------------  LocalContentManager
  
   public void initialize()
   {
      String profileName = profileKey.getName();
      VirtualFile backupRoot = VFS.getChild("/profileservice/originals/");
     
      for (Map.Entry<String, URI> entry : namedURIMap.entrySet())
      {
         VirtualFile backup = backupRoot.getChild(profileName).getChild("roots").getChild(entry.getKey());
         Closeable closeable =  mountRepositoryRoot(entry.getValue(), backup);
         vfCache.put(entry.getKey(), backup);
         mounts.put(entry.getKey(), closeable);
      }
   }
View Full Code Here

         {
            RepositoryRootMetadata rmd = new RepositoryRootMetadata();
            rmd.setName(entry.getKey());
            RepositoryRootMetadata existingRmd = official == null ? null : official.getRepositoryRootMetadata(entry.getKey());
           
            VirtualFile root = entry.getValue();        
            if (isDirectory(root))
            {
               for(VirtualFile child: root.getChildren())
               {
                  createItemMetadataFromScan(rmd, existingRmd, child, root);
               }
            }
            else
View Full Code Here

TOP

Related Classes of org.jboss.vfs.VirtualFile

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.