Examples of VFSDeploymentUnit


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

      }
      Class<?>[] typesArray = typesMap.keySet().toArray(new Class<?>[0]);
      // Find classes which extend, implement, or are annotated by HandlesTypes
      if (typesArray.length > 0 && unit instanceof VFSDeploymentUnit)
      {
         VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit) unit;
         List<VirtualFile> classpath = vfsUnit.getClassPath();
         try
         {
            for (VirtualFile classpathItem : classpath)
            {
               for (Class<?> type : typesArray)
View Full Code Here

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

      while (tempDeploymentUnit.isComponent())
         tempDeploymentUnit = tempDeploymentUnit.getParent();

      if (tempDeploymentUnit instanceof VFSDeploymentUnit)
      {
         VFSDeploymentUnit vdu = (VFSDeploymentUnit) tempDeploymentUnit;
         return new VirtualFileAdaptor(vdu.getRoot());
      }
      else
      {
         throw new IllegalArgumentException("Can only handle real VFS deployments: " + tempDeploymentUnit);
      }
View Full Code Here

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

   protected abstract int getExpectedArchives();

   public void testSimpleUsage() throws Exception
   {
      VirtualFile ear = createBasicEar(MockEmptyEjbServices.class);
      VFSDeploymentUnit topUnit = assertDeploy(ear);
      try
      {
         assertBean(DeployersUtils.getBootstrapBeanName(topUnit), null, Object.class);

         Object bean = getBean(Deployment.class);
         Deployment deployment = assertInstanceOf(bean, Deployment.class, false);
         initializeDeployment(deployment);
        
         List<BeanDeploymentArchive> archives = new ArrayList<BeanDeploymentArchive>();
         getArchives(archives, deployment.getBeanDeploymentArchives());
         assertEquals(getExpectedArchives(), archives.size());

         //List<BeansXml> urls = new ArrayList<BeansXml>();
         List<String> classes = new ArrayList<String>();
         for (BeanDeploymentArchive bad : archives)
         {
            //urls.add(bad.getBeansXml());
            for (String clazz : bad.getBeanClasses())
               classes.add(clazz);
         }

         Set<String> expected = new HashSet<String>();
//         addExpectedResource(expected, "ejbs.jar");
//         addExpectedResource(expected, "ext.jar");
//         addExpectedResource(expected, "simple.jar");
//         addExpectedResource(expected, "ui.jar");
//         addExpectedResource(expected, "crm.jar");
//         addExpectedResource(expected, "simple.war", "/WEB-INF/beans.xml");
//
//         assertEquals("Illegal size or urls.", expected.size(), urls.size());

//         for (URL url : urls)
//         {
//            boolean found = false;
//            Iterator<String> iter = expected.iterator();
//            while (iter.hasNext())
//            {
//               String expectedURL = iter.next();
//               if (url.toExternalForm().contains(expectedURL))
//               {
//                  iter.remove();
//                  found = true;
//                  break;
//               }
//            }
//            assertTrue("Unexpected wb url: " + url, found);
//         }

         addExpectedClass(expected, BusinessInterface.class);
         addExpectedClass(expected, MySLSBean.class);
         addExpectedClass(expected, ExternalWebBean.class);
         addExpectedClass(expected, PlainJavaBean.class);
         addExpectedClass(expected, UIWebBean.class);
         addExpectedClass(expected, ServletWebBean.class);
         addExpectedClass(expected, CrmWebBean.class);

         assertEquals("Illegal size or classes.", classes.size(), expected.size());

         for (String className : classes)
            assertTrue(expected.remove(className));

         assertEmpty("Should be emtpy, missing " + expected, expected);

         Class<?> newBeanClass = topUnit.getClassLoader().loadClass("org.jboss.test.deployers.support.MockTransactionServices");
         BeanDeploymentArchive newBDA = deployment.loadBeanDeploymentArchive(newBeanClass);
         assertNewBeanDeploymentArchive(archives, newBDA);
      }
      finally
      {
View Full Code Here

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

         // 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.getPhysicalURL(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

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

   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

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

      VirtualFile webInfLib = null;
      boolean fragmentFound = false;
      HashMap<String, WebFragmentMetaData> webFragments = new HashMap<String, WebFragmentMetaData>();
      if (unit instanceof VFSDeploymentUnit)
      {
         VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit) unit;
         webInfLib = vfsUnit.getFile("WEB-INF/lib");
         if (webInfLib != null)
         {
            List<VirtualFile> jars = webInfLib.getChildren();
            for (VirtualFile jar : jars)
            {
View Full Code Here

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

   public void internalDeploy(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

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

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

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

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

   public void undeploy(DeploymentUnit unit, T deployment)
   {
      if (unit instanceof VFSDeploymentUnit == false)
         return;
     
      VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit;
      undeploy(vfsDeploymentUnit, deployment);
   }
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.