Package org.jboss.metadata.web.spec

Examples of org.jboss.metadata.web.spec.ServletMetaData


      {
         for (PortComponentMetaData pcmd : wsd.getPortComponents())
         {
            final String servletName = pcmd.getServletLink();
            this.log.debug("JSE name: " + servletName);
            final ServletMetaData servletMD = ASHelper.getServletForName(webMetaData, servletName);
            final String servletClass = ASHelper.getEndpointName(servletMD);
            this.log.debug("JSE class: " + servletClass);

            this.newHttpEndpoint(servletClass, servletName, dep);
         }
View Full Code Here


      /**
       * If the metaData is null, this is an internal call made by RealmBase.hasResourcePermission
       */
      if (metaData != null)
      {
         ServletMetaData servletMD = metaData.getServlets().get(servletName);
         SecurityRoleRefsMetaData roleRefs = null;
         if (servletMD != null)
            roleRefs = servletMD.getSecurityRoleRefs();
         if (roleRefs != null)
         {
            for (SecurityRoleRefMetaData ref : roleRefs)
            {
               if (ref.getRoleLink().equals(role))
View Full Code Here

   public SecurityRoleRefsMetaData getSecurityRoleRefs(String servletName)
   {
      SecurityRoleRefsMetaData refs = null;
      if(getServlets() != null)
      {
         ServletMetaData servlet = getServlets().get(servletName);
         if (servlet != null)
         {
            refs = servlet.getSecurityRoleRefs();
         }
      }
      return refs;
   }
View Full Code Here

      if (identity == null)
      {
         JBossServletsMetaData servlets = getServlets();
         if(servlets != null)
         {
            ServletMetaData servlet = servlets.get(servletName);
            if (servlet != null)
            {
               // Check for a web.xml run-as only specification
               synchronized (runAsIdentity)
               {
                  RunAsMetaData runAs = servlet.getRunAs();
                  if (runAs != null)
                  {
                     String roleName = runAs.getRoleName();
                     identity = new RunAsIdentityMetaData(roleName, null);
                     runAsIdentity.put(servletName, identity);
View Full Code Here

      RunAs annotation = finder.getAnnotation(type, RunAs.class);
      if(annotation == null)
         return;

      RunAsMetaData runAs = super.create(type);
      ServletMetaData servlet = new ServletMetaData();
      servlet.setServletName(type.getSimpleName());
      servlet.setServletClass(type.getName());
      servlet.setRunAs(runAs);
      metaData.add(servlet);
   }
View Full Code Here

        }
    }

    private static POJOEndpoint newPojoEndpoint(final PortComponentMetaData portComponentMD, final JBossWebMetaData jbossWebMD) {
        final String endpointName = portComponentMD.getServletLink();
        final ServletMetaData servletMD = getServletForName(jbossWebMD, endpointName);
        final String endpointClassName = getEndpointClassName(servletMD);
        final String urlPattern = getUrlPattern(endpointName, jbossWebMD);

        return new POJOEndpoint(endpointName, endpointClassName, urlPattern);
    }
View Full Code Here

                servletName = getServletName(servlet);
            }
            if (servletName == null)
                throw new IllegalStateException("servletName is null");
            String roleName = role;
            ServletMetaData servletMD = metaData.getServlets().get(servletName);
            SecurityRoleRefsMetaData roleRefs = null;
            if (servletMD != null)
                roleRefs = servletMD.getSecurityRoleRefs();
            if (roleRefs != null) {
                for (SecurityRoleRefMetaData ref : roleRefs) {
                    if (ref.getRoleLink().equals(role)) {
                        roleName = ref.getName();
                        break;
View Full Code Here

        final ModelNode resourcesConfig = config.get(STATIC_RESOURCES);
        // Check disabled
        if (resourcesConfig.require(DISABLED).asBoolean()) {
            return;
        }
        final ServletMetaData servlet = new ServletMetaData();
        servlet.setName("default");
        servlet.setLoadOnStartup("" + 1);
        if (resourcesConfig.require(WEBDAV).asBoolean()) {
            servlet.setServletClass("org.apache.catalina.servlets.WebdavServlet");
        } else {
            servlet.setServletClass("org.apache.catalina.servlets.DefaultServlet");
        }

        final List<ParamValueMetaData> initParams = new ArrayList<ParamValueMetaData>();
        initParams.add(createParameter("listings", resourcesConfig.require(LISTINGS).asString()));
        initParams.add(createParameter("readonly", resourcesConfig.require(READ_ONLY).asString()));
        initParams.add(createParameter("sendfile", resourcesConfig.require(SENDFILE).asString()));

        if (resourcesConfig.hasDefined(FILE_ENCODING)) {
            initParams.add(createParameter("file-encoding", resourcesConfig.get(FILE_ENCODING).asString()));
        }
        if (resourcesConfig.hasDefined(SECRET)) {
            initParams.add(createParameter("secret", resourcesConfig.get(SECRET).asString()));
        }
        initParams.add(createParameter("max-depth", resourcesConfig.require(MAX_DEPTH).asString()));

        servlet.setInitParam(initParams);
        metadata.getServlets().add(servlet);
        addServletMapping("default", metadata, "/");
    }
View Full Code Here

    void enableJsp(final WebMetaData metadata) {
        final ModelNode config = this.config.get(JSP_CONFIGURATION);
        if (config.get(DISABLED).asBoolean(false)) {
            return;
        }
        final ServletMetaData servlet = new ServletMetaData();
        servlet.setName("jsp");
        servlet.setLoadOnStartup("" + 3);
        servlet.setServletClass("org.apache.jasper.servlet.JspServlet");

        final List<ParamValueMetaData> initParams = new ArrayList<ParamValueMetaData>();

        initParams.add(createParameter("development", config.require(DEVELOPMENT).asString()));
        initParams.add(createParameter("keepgenerated", config.require(KEEP_GENERATED).asString()));
        initParams.add(createParameter("trimSpaces", config.require(TRIM_SPACES).asString()));
        initParams.add(createParameter("enablePooling", config.require(TAG_POOLING).asString()));
        initParams.add(createParameter("mappedfile", config.require(MAPPED_FILE).asString()));
        initParams.add(createParameter("checkInterval", config.require(CHECK_INTERVAL).asString()));
        initParams.add(createParameter("modificationTestInterval", config.require(MODIFICATION_TEST_INTERVAL).asString()));
        initParams.add(createParameter("recompileOnFail", config.require(RECOMPILE_ON_FAIL).asString()));
        initParams.add(createParameter("suppressSmap", config.require(SMAP).asString()));
        initParams.add(createParameter("dumpSmap", config.require(DUMP_SMAP).asString()));
        initParams.add(createParameter("genStringAsCharArray", config.require(GENERATE_STRINGS_AS_CHAR_ARRAYS).asString()));
        initParams.add(createParameter("errorOnUseBeanInvalidClassAttribute", config.require(ERROR_ON_USE_BEAN_INVALID_CLASS_ATTRIBUTE).asString()));

        if (config.hasDefined(SCRATCH_DIR)) {
            initParams.add(createParameter("scratchdir", config.require(SCRATCH_DIR).asString()));
        }
        // jasper will find the right defaults.
        initParams.add(createParameter("compilerSourceVM", config.require(SOURCE_VM).asString()));
        initParams.add(createParameter("compilerTargetVM", config.require(TARGET_VM).asString()));
        initParams.add(createParameter("javaEncoding", config.require(JAVA_ENCODING).asString()));
        initParams.add(createParameter("xpoweredBy", config.require(X_POWERED_BY).asString()));
        initParams.add(createParameter("displaySourceFragment", config.require(DISPLAY_SOURCE_FRAGMENT).asString()));

        servlet.setInitParam(initParams);
        metadata.getServlets().add(servlet);
        addServletMapping("jsp", metadata, "*.jsp", "*.jspx");
    }
View Full Code Here

      /**
       * If the metaData is null, this is an internal call made by RealmBase.hasResourcePermission
       */
      if (metaData != null)
      {
         ServletMetaData servletMD = metaData.getServlets().get(servletName);
         SecurityRoleRefsMetaData roleRefs = null;
         if (servletMD != null)
            roleRefs = servletMD.getSecurityRoleRefs();
         if (roleRefs != null)
         {
            for (SecurityRoleRefMetaData ref : roleRefs)
            {
               if (ref.getRoleLink().equals(role))
View Full Code Here

TOP

Related Classes of org.jboss.metadata.web.spec.ServletMetaData

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.