Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.WebComponentDescriptor


        runAsPrincipals = new HashMap();
        Iterator bundle = webDesc.getWebComponentDescriptorsSet().iterator();
 
        while(bundle.hasNext()) {
           
            WebComponentDescriptor wcd = (WebComponentDescriptor)bundle.next();
            RunAsIdentityDescriptor runAsDescriptor = wcd.getRunAsIdentity();
     
            if (runAsDescriptor != null) {
                String principal = runAsDescriptor.getPrincipal();
                String servlet = wcd.getCanonicalName();
   
                if (principal == null || servlet == null) {
                    _logger.warning("web.realmadapter.norunas");
                } else {
                    runAsPrincipals.put(servlet, principal);
View Full Code Here


        String aliasUri = "";
        String currentUriExtension = "";
        String aliasUriExtension = "";       
        boolean isAliasExists = false;
        for (Iterator itr = webDesc.getWebComponentDescriptorsSet().iterator(); itr.hasNext();) {
            WebComponentDescriptor webComponentDescriptor = (WebComponentDescriptor)itr.next();
            servletUri = webComponentDescriptor.getWebComponentImplementation();

            currentUri = getResourceName( currentRequest.getRequestURI(), currentRequest.getContextPath());
            currentUriExtension = getExtension(currentUri);
           
            // First check the servlet mapping
            for (Iterator i = webComponentDescriptor.getUrlPatternsSet().iterator(); i.hasNext();) {
                aliasUri = i.next().toString();
                aliasUriExtension = getExtension(aliasUri);
               
                if (aliasUri.equalsIgnoreCase(currentUri)){
                    isAliasExists = true;
                    break;
                }    
               
                if (aliasUriExtension.equalsIgnoreCase(currentUriExtension)
                        && aliasUri.equalsIgnoreCase("*" + aliasUriExtension)){
                    isAliasExists = true;
                    break;
               
            }

            if (currentUri.equalsIgnoreCase(servletUri)
                    || isAliasExists){
                return webComponentDescriptor.getCanonicalName();
            }           
        }
        return UNCONSTRAINED;
    }
View Full Code Here

             */
            Set set = wbd.getWebComponentDescriptorsSet();        
            if (!set.isEmpty()) {
                Iterator<WebComponentDescriptor> iterator = set.iterator();
                while (iterator.hasNext()) {
                    WebComponentDescriptor webComponentDesc = iterator.next();
                    if ("jsp".equals(webComponentDesc.getCanonicalName())) {
                        Enumeration<InitializationParameter> en
                            = webComponentDesc.getInitializationParameters();
                        if (en != null) {
                            while (en.hasMoreElements()) {
                                InitializationParameter initP = en.nextElement();
                                configureJspc(jspc,
                                              initP.getName(),
View Full Code Here

        for(Iterator endpointIter = endpoints.iterator();
            endpointIter.hasNext();) {
           
            WebServiceEndpoint nextEndpoint = (WebServiceEndpoint)
            endpointIter.next();
            WebComponentDescriptor webComp = nextEndpoint.getWebComponentImpl();
            String servletImplClass = nextEndpoint.getServletImplClass();
            if( !nextEndpoint.hasServletImplClass() ) {
                throw new Exception(
                localStrings.getStringWithDefault(
                "enterprise.deployment.backend.cannot_find_servlet",
                "Runtime settings error.  Cannot find servlet-impl-class for endpoint {0} ",
                new Object[] {nextEndpoint.getEndpointName()}));
            }
           
            if( !nextEndpoint.getWebService().hasFilePublishing() ) {
                // @@@ add security attributes as well????
                String publishingUri = nextEndpoint.getPublishingUri();
                String publishingUrlPattern =
                (publishingUri.charAt(0) == '/') ?
                publishingUri : "/" + publishingUri + "/*";
                webComp.addUrlPattern(publishingUrlPattern);
            }
           
            Class servletImplClazz  = loader.loadClass(servletImplClass);
            String containerServlet;
            // For versions above 1.1, use JAXWSServlet
            if("1.1".compareTo(web.getWebServices().getSpecVersion())<0) {
                containerServlet = "com.sun.enterprise.webservice.JAXWSServlet";                                   
            } else {
                containerServlet =
                SingleThreadModel.class.isAssignableFrom(servletImplClazz) ?
                "com.sun.enterprise.webservice.SingleThreadJAXRPCServlet" :
                    "com.sun.enterprise.webservice.JAXRPCServlet";
            }
            webComp.setWebComponentImplementation(containerServlet);
        }
    }
View Full Code Here

        Set servlets;
        Iterator itr;
        String epValue;
  Result result = getInitializedResult();
  ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        WebComponentDescriptor servlet;
        Enumeration en;
        EnvironmentProperty ep = null;
        boolean oneFailed = false;
        boolean status = false;
        boolean notApp = false;
       
  if (!descriptor.getServletDescriptors().isEmpty()) {
           
      // get the servlets in this .war
      servlets = descriptor.getServletDescriptors();
      itr = servlets.iterator();
      // test the servlets in this .war
      while (itr.hasNext()) {
    servlet = (WebComponentDescriptor)itr.next();
                en = servlet.getInitializationParameters();
                if (en.hasMoreElements()) {
                    ep = (EnvironmentProperty)en.nextElement();
                    epValue = ep.getValue();
                    if (epValue.length() != 0) {
      result.addGoodDetails(smh.getLocalString
               ("tests.componentNameConstructor",
          "For [ {0} ]",
          new Object[] {compName.toString()}));
                        result.addGoodDetails(smh.getLocalString
                                              (getClass().getName() + ".passed",
                                               "Param named/value exists for in the servlet [ {0} ].",
                                               new Object[] {servlet.getName()}));                             
                    } else {
                        // failed
                        oneFailed = true;
           result.addErrorDetails(smh.getLocalString
               ("tests.componentNameConstructor",
View Full Code Here

                if(servletsInFilter.size() > 0) {
                    Set servletDescriptor = descriptor.getServletDescriptors();
                    Iterator itr = servletDescriptor.iterator();
                    // test the servlets in this .war
                    while (itr.hasNext()) {
                        WebComponentDescriptor servlet = (WebComponentDescriptor) itr.next();
                        servletsInWAR.add(servlet.getCanonicalName());
                    }
                    if (!(servletsInWAR != null && servletsInWAR.containsAll(servletsInFilter))) {
                        addErrorDetails(result, compName);
                        result.failed(smh.getLocalString
                                (getClass().getName() + ".failed1",
View Full Code Here

        Set servlets;
        Iterator servItr;
        String epName = null;
  Result result = getInitializedResult();
  ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
        WebComponentDescriptor servlet = null;
        Enumeration en;
        EnvironmentProperty ep = null;
        boolean oneFailed = false;
        boolean duplicate = false;
       
  if (!descriptor.getServletDescriptors().isEmpty()) {
           
      // get the servlets in this .war
      servlets = descriptor.getServletDescriptors();
      servItr = servlets.iterator();
      // test the servlets in this .war
      while (servItr.hasNext()) {
    servlet = (WebComponentDescriptor)servItr.next();
                HashSet<String> envSet = new HashSet<String>();           
                for ( en = servlet.getInitializationParameters(); en.hasMoreElements();) {
                    ep = (EnvironmentProperty)en.nextElement();
                    epName = ep.getName();
                   
                    if (epName.length() != 0) {
                        // Do duplicate name test.
                        duplicate = checkDuplicate(epName, envSet);
                       
                    } else {
                        oneFailed = true;
      result.addErrorDetails(smh.getLocalString
               ("tests.componentNameConstructor",
          "For [ {0} ]",
          new Object[] {compName.toString()}));
                        result.addErrorDetails(smh.getLocalString
                                               (getClass().getName() + ".failed",
                                                "Error: Param name/value entry should of finite length."));
                    }
                    if ( !duplicate) {
                        envSet.add(epName);
                    }
                    else {
                        oneFailed = true;
      result.addErrorDetails(smh.getLocalString
               ("tests.componentNameConstructor",
          "For [ {0} ]",
          new Object[] {compName.toString()}));
                        result.addErrorDetails(smh.getLocalString
                                               (getClass().getName() + ".failed",
                                                "Error: Duplicate param names are not allowed."));
                    }
                }
            }
      result.addGoodDetails(smh.getLocalString
               ("tests.componentNameConstructor",
          "For [ {0} ]",
          new Object[] {compName.toString()}));
            result.addGoodDetails(smh.getLocalString
                                  (getClass().getName() + ".passed",
                                   "Param named/value exists for in the servlet [ {0} ].",
                                   new Object[] {servlet.getName()}));         
           
        } else {
            result.setStatus(Result.NOT_APPLICABLE);
      result.addNaDetails(smh.getLocalString
               ("tests.componentNameConstructor",
View Full Code Here

            } else {
               throw new WebServiceException("Cannot intialize the JAXRPCServlet for " + jndiNameEnv);
            }
            ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
            servletName = servletConfig.getServletName();
            WebComponentDescriptor webComponent =
                    webBundle.getWebComponentByCanonicalName(servletName);
            if( webComponent != null ) {
                WebServicesDescriptor webServices = webBundle.getWebServices();
                Collection endpoints =
                        webServices.getEndpointsImplementedBy(webComponent);
View Full Code Here

    void setServletName(Set webComponentDescriptors) {
        Iterator it = webComponentDescriptors.iterator();
        String endpointName = null;
        while (it.hasNext()) {
            WebComponentDescriptor desc = (WebComponentDescriptor)it.next();
            String name = desc.getCanonicalName();
            if (JAXWS_SERVLET.equals(desc.getWebComponentImplementation())) {
                endpointName = name;
            }
            if (desc.getSecurityRoleReferences().hasMoreElements()) {
                servletName = name;
                break;
            }
        }
        if (servletName == null) {
View Full Code Here

            WebBundleDescriptor webBundle = (WebBundleDescriptor) bundleDesc;
            if(endpoint.getWebComponentLink() == null) {
                endpoint.setWebComponentLink(portComponentName);
            }
            if(endpoint.getWebComponentImpl() == null) {
                WebComponentDescriptor webComponent = (WebComponentDescriptor) webBundle.
                    getWebComponentByCanonicalName(endpoint.getWebComponentLink());

                // if servlet is not known, we should add it now
                if (webComponent == null) {
                    webComponent = new WebComponentDescriptorImpl();
                    webComponent.setServlet(true);
                    webComponent.setWebComponentImplementation(((Class) annElem).getCanonicalName());
                    webComponent.setName(endpoint.getEndpointName());
                    webComponent.addUrlPattern("/"+newWS.getName());
                    webBundle.addWebComponentDescriptor(webComponent);
                }
                endpoint.setWebComponentImpl(webComponent);
            }
        } else {
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.WebComponentDescriptor

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.