Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.WebComponentDescriptor


            } 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


        runAsPrincipals = new HashMap<String, String>();
        Iterator bundle = webDesc.getWebComponentDescriptors().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

        runAsPrincipals = new HashMap<String, String>();
        Iterator bundle = webDesc.getWebComponentDescriptors().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

        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

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

            WebServlet webServletAn = (WebServlet)ainfo.getAnnotation();
            Class webCompClass = (Class)ainfo.getAnnotatedElement();
            String servletName = getServletName(webServletAn, webCompClass);

            // create a WebComponentDescriptor if there is none
            WebComponentDescriptor webCompDesc =
                webBundleContext.getDescriptor().getWebComponentByCanonicalName(servletName);
            if (webCompDesc == null) {
                createWebComponentDescriptor(servletName, webCompClass,
                        webBundleContext.getDescriptor());
            }
View Full Code Here

        WebServlet webServletAn = (WebServlet)ainfo.getAnnotation();

        Class webCompClass = (Class)ainfo.getAnnotatedElement();
        String servletName = getServletName(webServletAn, webCompClass);

        WebComponentDescriptor webCompDesc =
            webBundleContext.getDescriptor().getWebComponentByCanonicalName(servletName);
        if (webCompDesc == null) {
            webCompDesc = createWebComponentDescriptor(servletName, webCompClass,
                    webBundleContext.getDescriptor());
        }
View Full Code Here

    }

    private WebComponentDescriptor createWebComponentDescriptor(String servletName,
            Class<?> webCompClass, WebBundleDescriptor webBundleDescriptor) {

        WebComponentDescriptor webCompDesc = new WebComponentDescriptorImpl();
        webCompDesc.setName(servletName);
        webCompDesc.setCanonicalName(servletName);
        webCompDesc.setServlet(true);
        webCompDesc.setWebComponentImplementation(webCompClass.getName());
        webBundleDescriptor.addWebComponentDescriptor(webCompDesc);
        return webCompDesc;
    }
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.