Examples of DeploymentUnit


Examples of org.jboss.deployers.structure.spi.DeploymentUnit

      ModuleMetaData conflict = new ModuleMetaData();
      conflict.setName(SIMPLE_DU_JAR_PATH);
      conflict.setUniqueName(SIMPLE_TRIMMED_PATH);
      modules.add(conflict);
     
      DeploymentUnit unit = getDeploymentUnitProxy(duih);
      testee.deploy(unit);
      assertEquals(SIMPLE_DU_WAR_PATH, getSingleAttachment(duih).getModuleName());
      assertEquals(SIMPLE_DU_WAR_PATH, duih.getModuleName(NamedModule.class));
     
      ModuleMetaData modmd = getModuleMetaData(duih);
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentUnit

      conflict4.setUniqueName(SIMPLE_TRIMMED_PATH + "-1");
      modules.add(conflict4);
     
      String expected = "test-1";
     
      DeploymentUnit unit = getDeploymentUnitProxy(duih);
      testee.deploy(unit);
      assertEquals(expected, md.getModuleName());
      assertEquals(expected, duih.getModuleName(NamedModule.class));
     
      ModuleMetaData modmd = getModuleMetaData(duih);
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentUnit

      conflict4.setUniqueName(SIMPLE_TRIMMED_PATH + "-1");
      modules.add(conflict4);
     
      String expected = SIMPLE_TRIMMED_PATH + "-2";
     
      DeploymentUnit unit = getDeploymentUnitProxy(duih);
      testee.deploy(unit);
      assertEquals(expected, getSingleAttachment(duih).getModuleName());
      assertEquals(expected, duih.getModuleName(NamedModule.class));
     
      ModuleMetaData modmd = getModuleMetaData(duih);
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentUnit

   public void testConcurrentDeployments() throws InterruptedException
   {
      // Set up an ear with a war, jar, ear
     
      DUIH parentDUIH = getParentDUIH(true);
      DeploymentUnit parent = getDeploymentUnitProxy(parentDUIH);
      JBossAppMetaData appmd = (JBossAppMetaData) parentDUIH.attachments.get(JBossAppMetaData.class);
      ModulesMetaData modsmd = appmd.getModules();
     
      DUIH war = getSingleAttachmentDUIH(); // this does most setup for war
      war.parent = parent;
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentUnit

   // TODO: wire via SPI or deprecated this construct in favor of a generic JavaEE module informer
   private SimpleJavaEEModuleIdentifier identifier = new SimpleJavaEEModuleIdentifier();
  
   public String getApplicationName(DeploymentUnit unit)
   {
      DeploymentUnit topLevel = unit.getTopLevel();
      if(topLevel.isAttachmentPresent(JBossAppMetaData.class))
         return topLevel.getSimpleName();
      return null;
   }
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentUnit

   public String getModulePath(DeploymentUnit unit)
   {
      // first check if this a JavaEE Application (i.e. if it's a .ear).
      // If yes, then return the relative path (i.e. module name) of the unit
      // relative to the .ear
      DeploymentUnit topLevel = unit.getTopLevel();
      if(topLevel.isAttachmentPresent(JBossAppMetaData.class))
      {
         return unit.getRelativePath();
      }
      // if it's not a JavaEE application (i.e. not a .ear), then
      // return the simple name of the unit
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentUnit

                  + MessageDestinationReferenceResolver.class.getName());
         }
         else
         {
            // the DU which depends on this message-destination-ref
            DeploymentUnit dependentDU = unit;
            // the MessageDestinationReferenceResolver works on non-component deployment units.
            // So if we are currently processing component DUs (like we do for EJBs), then pass the
            // component DUs parent during resolution.
            if (unit.isComponent())
            {
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentUnit

    * @param di the module
    * @return .ear parent shortname, or null
    */
   public static String findEarParent(DeploymentUnit di)
   {
      DeploymentUnit parent = di.getParent();
      if (parent != null && parent.getSimpleName().endsWith(".ear"))
      {
         return parent.getSimpleName();
      }
      else
      {
         return null;
      }
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentUnit

    return datasourceDeployments;
  }
 
  private void attachManagedConnectionFactories(DeploymentUnit unit, Collection<DataSourceDeploymentMetaData> datasourceDeployments)
  {
     DeploymentUnit nonComponentDU =  unit.isComponent() ? unit.getParent() : unit;
     ManagedConnectionFactoryDeploymentGroup managedConnectionFactories = nonComponentDU.getAttachment(ManagedConnectionFactoryDeploymentGroup.class);
       if (managedConnectionFactories == null)
       {
          managedConnectionFactories = new ManagedConnectionFactoryDeploymentGroup();
       }
      
       for (DataSourceDeploymentMetaData dataSourceDeployment : datasourceDeployments)
       {
          managedConnectionFactories.addManagedConnectionFactoryDeployment(dataSourceDeployment);
       }
       nonComponentDU.addAttachment(ManagedConnectionFactoryDeploymentGroup.class, managedConnectionFactories);
  }
View Full Code Here

Examples of org.jboss.deployers.structure.spi.DeploymentUnit

      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      metaData.setContextLoader(loader);

      StandardContext context = (StandardContext)Class.forName(config.getContextClassName()).newInstance();

      DeploymentUnit depUnit = webApp.getDeploymentUnit();

      // Find all TLDs that have been processed by deployers, and place them in a map keyed by location
      Map<String, TldMetaData> tldMetaDataMap = new HashMap<String, TldMetaData>();
      Map<String, Object> attachements = depUnit.getAttachments();
      Iterator<String> attachementNames = attachements.keySet().iterator();
      while (attachementNames.hasNext()) {
         String name = attachementNames.next();
         Object attachement = depUnit.getAttachment(name);
         if (attachement != null && attachement instanceof TldMetaData
               && name.startsWith(TldMetaData.class.getName() + ":"))
         {
            tldMetaDataMap.put(name, (TldMetaData) attachement);
         }
      }
      List<TldMetaData> sharedTldMetaData = (List<TldMetaData>)
         depUnit.getAttachment(SharedTldMetaDataDeployer.SHARED_TLDS_ATTACHMENT_NAME);
      if (sharedTldMetaData != null)
      {
         for (TldMetaData tldMetaData : sharedTldMetaData)
         {
            tldMetaDataMap.put("shared:" + tldMetaData.toString(), tldMetaData);
         }
      }
     
      this.component = createJavaEEComponent();

      TomcatInjectionContainer injectionContainer =
         new TomcatInjectionContainer(webApp, depUnit, context,
               getPersistenceUnitDependencyResolver(), config.getDynamicClassloaders(), component, this.getInjectionManager());

      Loader webLoader = depUnit.getAttachment(Loader.class);
      if (webLoader == null)
         webLoader = getWebLoader(depUnit, metaData, loader, warUrl, injectionContainer);

      webApp.setName(warUrl.getPath());
      webApp.setClassLoader(loader);
      webApp.setURL(warUrl);

      String objectNameS = config.getCatalinaDomain() + ":j2eeType=WebModule,name=//" + ((hostName == null) ? "localhost" : hostName) + ctxPath
            + ",J2EEApplication=none,J2EEServer=none";

      ObjectName objectName = new ObjectName(objectNameS);

      if (Registry.getRegistry(null, null).getMBeanServer().isRegistered(objectName))
         throw new DeploymentException("Web mapping already exists for deployment URL " + warUrlStr);

      Registry.getRegistry(null, null).registerComponent(context, objectName, config.getContextClassName());

      context.setInstanceManager(injectionContainer);
      context.setPublicId(metaData.getPublicID());

      String docBase = depUnit.getAttachment("org.jboss.web.explicitDocBase", String.class);
      if (docBase == null)
         docBase = VFS.getChild(warUrl).getPhysicalFile().getAbsolutePath();

      context.setDocBase(docBase);
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.