Package org.jboss.metadata.web.jboss

Examples of org.jboss.metadata.web.jboss.JBossWebMetaData


   {
      ClassLoader cl = Thread.currentThread().getContextClassLoader();
      URL webxml = cl.getResource("security/jacc/webperm/web.xml");
      assertNotNull("web.xml exists?", webxml);
      WebMetaData wmd = getWebMetaData(webxml.openStream());
      JBossWebMetaData jwmd = new JBossWebMetaData();
      jwmd.merge(null, wmd);
      TestJBossPolicyConfiguration tpc = new TestJBossPolicyConfiguration("dummy");
      WebPermissionMapping.createPermissions(jwmd, tpc);
      checkUncheckedPermissions(tpc.getUncheckedPolicy());
      checkExcludedPermissions(tpc.getExcludedPolicy());
      checkAddToRoleForAdministrator(tpc.getPermissionsForRole("Administrator"));
View Full Code Here


      setName("jboss-web.xml");
   }

   protected JBossWebMetaData parse(VFSDeploymentUnit unit, VirtualFile file, JBossWebMetaData root) throws Exception
   {
      return new JBossWebMetaData();
   }
View Full Code Here

      setName("web.xml");
   }

   protected JBossWebMetaData parse(VFSDeploymentUnit unit, VirtualFile file, JBossWebMetaData root) throws Exception
   {
      return new JBossWebMetaData();
   }
View Full Code Here

   }
  
   private static DUIH getMultiAttachmentDUIH()
   {
      DUIH duih = new DUIH();
      JBossWebMetaData webmd = new JBossWebMetaData();
      duih.attachments.put(JBossWebMetaData.class, webmd);
      JBossMetaData ejbmd = new JBossMetaData();
      duih.attachments.put(JBossMetaData.class, ejbmd);
      JBossClientMetaData clientmd = new JBossClientMetaData();
      duih.attachments.put(JBossClientMetaData.class, clientmd);
View Full Code Here

   }
  
   private static DUIH getSingleAttachmentDUIH()
   {
      DUIH duih = new DUIH();
      JBossWebMetaData webmd = new JBossWebMetaData();
      duih.attachments.put(JBossWebMetaData.class, webmd);
      return duih;
   }
View Full Code Here

   }

   private boolean isSharedENC(org.jboss.deployers.structure.spi.DeploymentUnit deploymentUnit)
   {
      JBossMetaData jbossMetaData = deploymentUnit.getAttachment(JBossMetaData.class);
      JBossWebMetaData jbosswebMetaData = deploymentUnit.getAttachment(JBossWebMetaData.class);
      if (jbossMetaData != null && jbosswebMetaData != null)
      {
         return true;
      }
      return false;
View Full Code Here

   public void testMaxInactiveIntervalReplication() throws Exception
   {
      log.info("Enter testMaxInactiveIntervalReplication");
     
      ++testCount;
      JBossWebMetaData webMetaData = SessionTestUtil.createWebMetaData(2);
      for (int i = 0; i < cacheContainers.length; ++i)
      {
         cacheContainers[i] = SessionTestUtil.createCacheContainer(false, null, true, false);
         cacheContainers[i].start();
        
View Full Code Here

   }
  
   @Override
   protected DataSourcesMetaData getDataSources(DeploymentUnit unit)
   {
      JBossWebMetaData jbosswebMetaData = unit.getAttachment(JBossWebMetaData.class);

      if (!jbosswebMetaData.is30() || jbosswebMetaData.getJndiEnvironmentRefsGroup() == null)
      {
         return null;
      }
      return jbosswebMetaData.getJndiEnvironmentRefsGroup().getDataSources();
   }
View Full Code Here

   protected void performDeploy(WebApplication webApp, String warUrl) throws Exception
   {
      // Decode the URL as tomcat can't deal with paths with escape chars
      warUrl = URLDecoder.decode(warUrl, "UTF-8");
      webApp.setDomain(config.getCatalinaDomain());
      JBossWebMetaData metaData = webApp.getMetaData();
      // Get any jboss-web/virtual-hosts
      List<String> vhostNames = metaData.getVirtualHosts();
      // Map the virtual hosts onto the configured hosts
      String hostName = mapVirtualHosts(vhostNames);
      if (hostName == null)
      {
         Iterator hostNames = getDefaultHosts();
View Full Code Here

      performDeployInternal(webApp, hostName, warUrl);
   }

   protected void performDeployInternal(WebApplication webApp, String hostName, String warUrlStr) throws Exception
   {
      JBossWebMetaData metaData = webApp.getMetaData();
      String ctxPath = metaData.getContextRoot();
      if (ctxPath.equals("/") || ctxPath.equals("/ROOT") || ctxPath.equals(""))
      {
         log.debug("deploy root context=" + ctxPath);
         ctxPath = "/";
         metaData.setContextRoot(ctxPath);
      }

      log.info("deploy, ctxPath=" + ctxPath);

      URL warUrl = new URL(warUrlStr);

      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);

      // If there is an alt-dd set it
      if (metaData.getAlternativeDD() != null)
      {
         log.debug("Setting altDDName to: " + metaData.getAlternativeDD());
         context.setAltDDName(metaData.getAlternativeDD());
      }
      context.setJavaVMs(javaVMs);
      context.setServer(serverName);

      if (webLoader != null)
      {
         context.setLoader(webLoader);
      }
      else
      {
         context.setParentClassLoader(loader);
      }

      // Set the session cookies flag according to metadata
      switch (metaData.getSessionCookies())
      {
         case JBossWebMetaData.SESSION_COOKIES_ENABLED:
            context.setCookies(true);
            log.debug("Enabling session cookies");
            break;
         case JBossWebMetaData.SESSION_COOKIES_DISABLED:
            context.setCookies(false);
            log.debug("Disabling session cookies");
            break;
         default:
            log.debug("Using session cookies default setting");
      }

      String metaDataSecurityDomain = metaData.getSecurityDomain();
      if (metaDataSecurityDomain != null)
         metaDataSecurityDomain = metaDataSecurityDomain.trim();
     
      // Add a valve to establish security and naming context
      SecurityContextEstablishmentValve scevalve = new SecurityContextEstablishmentValve(metaDataSecurityDomain, SecurityUtil.unprefixSecurityDomain(config
View Full Code Here

TOP

Related Classes of org.jboss.metadata.web.jboss.JBossWebMetaData

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.