Package com.sun.enterprise.deployment.runtime.web

Examples of com.sun.enterprise.deployment.runtime.web.SunWebApp


                ((WebBundleDescriptor)webBundleDescriptor).addEnvironmentProperty(envEntry);
            }

            ContextResource[] resources = context.findResources();
            ResourceReferenceDescriptor resourceReference;
            SunWebApp iasBean =
                    ((WebBundleDescriptor)webBundleDescriptor).getSunDescriptor();
            ResourceRef[] rr = iasBean.getResourceRef();
            DefaultResourcePrincipal drp;
            ResourcePrincipal rp;
           
            for (int i=0; i<resources.length; i++) {
                resourceReference = new ResourceReferenceDescriptor(
View Full Code Here


  else super.addDescriptor(descriptor);
    }

    public void startElement(XMLElement element, Attributes attributes) {
        if (element.getQName().equals(RuntimeTagNames.PARAMETER_ENCODING)) {
            SunWebApp sunWebApp = (SunWebApp)getDescriptor();
            sunWebApp.setParameterEncoding(true);
            for (int i=0; i<attributes.getLength();i++) {
                if (RuntimeTagNames.DEFAULT_CHARSET.equals(
                    attributes.getQName(i))) {
                    sunWebApp.setAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.DEFAULT_CHARSET, attributes.getValue(i));
                }
                if (RuntimeTagNames.FORM_HINT_FIELD.equals(
                    attributes.getQName(i))) {
                    sunWebApp.setAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.FORM_HINT_FIELD, attributes.getValue(i));
                }
            }
        } else super.startElement(element, attributes);
    }
View Full Code Here

     * @param the attribute value
     * @return true if the attribute was processed
     */
    protected boolean setAttributeValue(XMLElement elementName,
        XMLElement attributeName, String value) {
        SunWebApp sunWebApp = (SunWebApp)getDescriptor();
        if (attributeName.getQName().equals(RuntimeTagNames.ERROR_URL)) {
            sunWebApp.setAttributeValue(sunWebApp.ERROR_URL, value);
            return true;
        }
        if (attributeName.getQName().equals(RuntimeTagNames.HTTPSERVLET_SECURITY_PROVIDER)) {
            sunWebApp.setAttributeValue(sunWebApp.HTTPSERVLET_SECURITY_PROVIDER, value);
            return true;
        }

        return false;
    }
View Full Code Here

            throw new IllegalArgumentException(getClass() + " cannot handles descriptors of type " + descriptor.getClass());
        }
        WebBundleDescriptor bundleDescriptor = (WebBundleDescriptor) descriptor;
        Element web = (Element)super.writeDescriptor(parent, descriptor);
 
  SunWebApp sunWebApp = bundleDescriptor.getSunDescriptor();
       
        // context-root?
  appendTextChild(web, RuntimeTagNames.CONTEXT_ROOT, bundleDescriptor.getContextRoot());
       
  // security-role-mapping
  SecurityRoleMapping[] roleMappings = sunWebApp.getSecurityRoleMapping();
  if (roleMappings!=null && roleMappings.length>0) {
      SecurityRoleMappingNode srmn = new SecurityRoleMappingNode();
      for (int i=0;i<roleMappings.length;i++) {
    srmn.writeDescriptor(web, RuntimeTagNames.SECURITY_ROLE_MAPPING, roleMappings[i]);
      }
  }
 
  // servlet
  Set servlets = bundleDescriptor.getServletDescriptors();
  if (servlets!=null) {
      com.sun.enterprise.deployment.node.runtime.ServletNode node =
                new com.sun.enterprise.deployment.node.runtime.ServletNode();
      for (Iterator itr=servlets.iterator();itr.hasNext();) {
                WebComponentDescriptor servlet = (WebComponentDescriptor) itr.next();
    node.writeDescriptor(web, RuntimeTagNames.SERVLET, servlet);
      }
  }
 
        // idempotent-url-pattern
        IdempotentUrlPattern[] patterns = sunWebApp.getIdempotentUrlPatterns();
        if (patterns != null && patterns.length > 0) {
            IdempotentUrlPatternNode node = new IdempotentUrlPatternNode();
            for (int i = 0;i < patterns.length; i++) {
                node.writeDescriptor(web, RuntimeTagNames.IDEMPOTENT_URL_PATTERN, patterns[i]);
            }
        }     

  // session-config?
  if (sunWebApp.getSessionConfig()!=null) {
      SessionConfigNode scn = new SessionConfigNode();
      scn.writeDescriptor(web, RuntimeTagNames.SESSION_CONFIG, sunWebApp.getSessionConfig());
  }
       
  // ejb-ref*
  EjbRef[] ejbRefs = sunWebApp.getEjbRef();
  if (ejbRefs!=null && ejbRefs.length>0) {
      EjbRefNode node = new EjbRefNode();
      for (int i=0;i<ejbRefs.length;i++) {
    node.writeDescriptor(web, RuntimeTagNames.EJB_REF, ejbRefs[i]);
      }
  }       
 
  // resource-ref*
  ResourceRef[] resourceRefs = sunWebApp.getResourceRef();
  if (resourceRefs!=null && resourceRefs.length>0) {
      ResourceRefNode node = new ResourceRefNode();
      for (int i=0;i<resourceRefs.length;i++) {
    node.writeDescriptor(web, RuntimeTagNames.RESOURCE_REF, resourceRefs[i]);
      }
  }
       
  // resource-env-ref*
  ResourceEnvRef[] resourceEnvRefs = sunWebApp.getResourceEnvRef();
  if (resourceEnvRefs!=null && resourceEnvRefs.length>0) {
      ResourceEnvRefNode node = new ResourceEnvRefNode();
      for (int i=0;i<resourceEnvRefs.length;i++) {
    node.writeDescriptor(web, RuntimeTagNames.RESOURCE_ENV_REF, resourceEnvRefs[i]);
      }
  } 
       
  // service-ref*
  if (bundleDescriptor.hasServiceReferenceDescriptors()) {
      ServiceRefNode serviceNode = new ServiceRefNode();
      for (Iterator serviceItr=bundleDescriptor.getServiceReferenceDescriptors().iterator();
          serviceItr.hasNext();) {
    ServiceReferenceDescriptor next = (ServiceReferenceDescriptor) serviceItr.next();
    serviceNode.writeDescriptor(web, WebServicesTagNames.SERVICE_REF, next);
    }
  }       

        // message-destination-ref*
        MessageDestinationRefNode.writeMessageDestinationReferences(web,
            bundleDescriptor);

 
  // cache?
  Cache cache = sunWebApp.getCache();
  if (cache!=null) {
      CacheNode cn = new CacheNode();
      cn.writeDescriptor(web, RuntimeTagNames.CACHE, cache);
  }
 
  // class-loader?
        ClassLoader classLoader = sunWebApp.getClassLoader();
        if (classLoader!=null) {
            ClassLoaderNode cln = new ClassLoaderNode();
            cln.writeDescriptor(web, RuntimeTagNames.CLASS_LOADER, classLoader);
        }

  // jsp-config?
  if (sunWebApp.getJspConfig()!=null) {
      WebPropertyNode propertyNode = new WebPropertyNode();
      Node jspConfig = appendChild(web, RuntimeTagNames.JSP_CONFIG);
      propertyNode.writeDescriptor(jspConfig, RuntimeTagNames.PROPERTY, sunWebApp.getJspConfig().getWebProperty());
  }
 
  // locale-charset-info?
  if (sunWebApp.getLocaleCharsetInfo()!=null) {
      LocaleCharsetInfoNode localeNode = new LocaleCharsetInfoNode();
      localeNode.writeDescriptor(web, RuntimeTagNames.LOCALE_CHARSET_INFO,
        sunWebApp.getLocaleCharsetInfo());
 
 
        // parameter-encoding?
        if (sunWebApp.isParameterEncoding()) {
            Element parameter = (Element) appendChild(web, RuntimeTagNames.PARAMETER_ENCODING);

            if (sunWebApp.getAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.FORM_HINT_FIELD)!=null) {
                setAttribute(parameter, RuntimeTagNames.FORM_HINT_FIELD,
                (String) sunWebApp.getAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.FORM_HINT_FIELD));
            }

            if (sunWebApp.getAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.DEFAULT_CHARSET)!=null) {
                setAttribute(parameter, RuntimeTagNames.DEFAULT_CHARSET,
                (String) sunWebApp.getAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.DEFAULT_CHARSET));
            }
        }         

  // property*
  if (sunWebApp.getWebProperty()!=null) {
      WebPropertyNode props = new WebPropertyNode();
      props.writeDescriptor(web, RuntimeTagNames.PROPERTY, sunWebApp.getWebProperty());
  }
       
  // message-destination*
        RuntimeDescriptorNode.writeMessageDestinationInfo(web, bundleDescriptor);

  // webservice-description*
        WebServiceRuntimeNode webServiceNode = new WebServiceRuntimeNode();
        webServiceNode.writeWebServiceRuntimeInfo(web, bundleDescriptor);

        // error-url
        if (sunWebApp.getAttributeValue(sunWebApp.ERROR_URL) != null) {
            setAttribute(web, RuntimeTagNames.ERROR_URL, sunWebApp.getAttributeValue(sunWebApp.ERROR_URL));
        }

        // httpservlet-security-provider
        if (sunWebApp.getAttributeValue(sunWebApp.HTTPSERVLET_SECURITY_PROVIDER) != null) {
            setAttribute(web, RuntimeTagNames.HTTPSERVLET_SECURITY_PROVIDER,
                         sunWebApp.getAttributeValue(sunWebApp.HTTPSERVLET_SECURITY_PROVIDER));
        }

        return web;
    }
View Full Code Here

    public void createRoleMapper(BundleDescriptor descriptor, String name) {

        if (descriptor instanceof SipBundleDescriptor) {

            SipBundleDescriptor sbd = (SipBundleDescriptor) descriptor;
            SunWebApp sunSipDesc = sbd.getSipApplication().getSunSipDescriptor();
            SecurityRoleMapping[] srmList = sunSipDesc.getSecurityRoleMapping();

            //SecurityRoleMapping[] srmList = ((WebBundleDescriptor) descriptor).getSunDescriptor().getSecurityRoleMapping();
            SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryMgr.getFactory();

            //super.getDescriptor().getApplication().getRoleMapper().getName();
View Full Code Here

   
    public Map<String, String> readRunAs(BundleDescriptor descriptor, Map<String, String> srMap) {
        Map runAs = new HashMap<String,String>();
        if (descriptor instanceof SipBundleDescriptor) {
            SipBundleDescriptor sbd = (SipBundleDescriptor) descriptor;
            SunWebApp sunSipDesc = sbd.getSipApplication().getSunSipDescriptor();
            Servlet[] servlets = sunSipDesc.getServlet();
            if (servlets != null) {
                for (int i = 0; i < servlets.length; i++) {
                    Servlet servlet = servlets[i];
                    String prinName = servlet.getPrincipalName();
                    String sn = servlet.getServletName();
                    runAs.put(sn, prinName);
                }
            } else {

                SecurityRoleMapping[] srmList = sunSipDesc.getSecurityRoleMapping();

                //SecurityRoleMapping[] srmList = ((WebBundleDescriptor) descriptor).getSunDescriptor().getSecurityRoleMapping();
                SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryMgr.getFactory();

                //super.getDescriptor().getApplication().getRoleMapper().getName();
View Full Code Here

        return cid;
    }

    public void createRoleMapper(String name) {

        SunWebApp sunSipDesc = sbd.getSipApplication().getSunSipDescriptor();
        SecurityRoleMapping[] srmList = sunSipDesc.getSecurityRoleMapping();

        //SecurityRoleMapping[] srmList = ((WebBundleDescriptor) descriptor).getSunDescriptor().getSecurityRoleMapping();
        // SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryMgr.getFactory();

        //super.getDescriptor().getApplication().getRoleMapper().getName();
View Full Code Here

    public Map<String, String> readRunAs(BundleDescriptor descriptor, Map<String, String> srMap) {
        Map runAs = new HashMap<String, String>();
        if (descriptor instanceof SipBundleDescriptor) {
            SipBundleDescriptor sbd = (SipBundleDescriptor) descriptor;
            SunWebApp sunSipDesc = sbd.getSipApplication().getSunSipDescriptor();
            Servlet[] servlets = sunSipDesc.getServlet();
            if (servlets != null) {
                for (int i = 0; i < servlets.length; i++) {
                    Servlet servlet = servlets[i];
                    String prinName = servlet.getPrincipalName();
                    String sn = servlet.getServletName();
                    runAs.put(sn, prinName);
                }
            } else {

                SecurityRoleMapping[] srmList = sunSipDesc.getSecurityRoleMapping();

                //SecurityRoleMapping[] srmList = ((WebBundleDescriptor) descriptor).getSunDescriptor().getSecurityRoleMapping();
                // SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryMgr.getFactory();

                //super.getDescriptor().getApplication().getRoleMapper().getName();
View Full Code Here

        // env can be null if it's CMP SQL generation
        if (env == null) {
            return null;
        }
        if (env instanceof SipBundleDescriptor) {
            SunWebApp sunSipDesc = ((SipBundleDescriptor) env).getSipApplication().getSunSipDescriptor();
            WebProperty[] props = sunSipDesc.getWebProperty();
            if (props != null) {
                for (int i = 0; i < props.length; i++) {
                    WebProperty prop = props[i];
                    if ("trust-id-ref".equals(prop.getValue("name"))) {
                        return (String) prop.getValue("value");
View Full Code Here

        CODEBASE = removeSpaces(CONTEXT_ID);
        if (VirtualServer.ADMIN_VS.equals(getVirtualServers(appName))) {
            LoginConfiguration lgConf = wbd.getLoginConfiguration();
            if (lgConf != null) {
                String realmName = lgConf.getRealmName();
                SunWebApp sunDes = wbd.getSunDescriptor();
                if (sunDes != null) {
                    SecurityRoleMapping[] sr = sunDes.getSecurityRoleMapping();
                    if (sr != null) {
                        for (int i = 0; i < sr.length; i++) {
                            String[] principal = sr[i].getPrincipalName();
                            if (principal != null) {
                                for (int plen = 0; plen < principal.length; plen++) {
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.runtime.web.SunWebApp

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.