Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.WebComponentDescriptor


    protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
            WebComponentContext[] webCompContexts) throws AnnotationProcessorException {
        RunAs runAsAn = (RunAs)ainfo.getAnnotation();

        for (WebComponentContext webCompContext : webCompContexts) {
            WebComponentDescriptor webDesc = webCompContext.getDescriptor();
            // override by xml
            if (webDesc.getRunAsIdentity() != null) {
                continue;
            }
            String roleName = runAsAn.value();
            Role role = new Role(roleName);
            // add Role if not exists
            webDesc.getWebBundleDescriptor().addRole(role);
            RunAsIdentityDescriptor runAsDesc = new RunAsIdentityDescriptor();
            runAsDesc.setRoleName(roleName);
            webDesc.setRunAsIdentity(runAsDesc);
        }

        return getDefaultProcessedResult();
    }
View Full Code Here


        String servletName = webServletAn.name();
        if (servletName == null || servletName.length() == 0) {
            servletName = webCompClass.getName();
        }

        WebComponentDescriptor webCompDesc =
            webBundleContext.getDescriptor().getWebComponentByCanonicalName(servletName);
        if (webCompDesc == null) {
            webCompDesc = new WebComponentDescriptor();
            webCompDesc.setName(servletName);
            webCompDesc.setCanonicalName(servletName);
        }
       
        HandlerProcessingResult result = processAnnotation(ainfo, webCompDesc);
        if (result.getOverallResult() == ResultType.PROCESSED) {
            webBundleContext.getDescriptor().addWebComponentDescriptor(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 (webComponent == null) {
                    //GLASSFISH-3297
                    WebComponentDescriptor[] wcs = webBundle.getWebComponentByImplName(((Class) annElem).getCanonicalName());
                    if (wcs.length > 0) {
                        webComponent = wcs[0];
                    }
                }

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

        return null;
    }

    public Node writeDescriptor(Element root, WebBundleDescriptor webBundleDescriptor) {
        Node containerDescriptorNode = null;
        WebComponentDescriptor defaultServletDesc =
                webBundleDescriptor.getWebComponentByCanonicalName("default");
        InitializationParameter listingsParam = getDefaultServletInitParam(
                defaultServletDesc, "listings", false);
        InitializationParameter sortedByParam = getDefaultServletInitParam(
                defaultServletDesc, "sortedBy", false);
View Full Code Here

    }


    private void setDefaultServletInitParam(String name, String value) {
        WebBundleDescriptor descriptor = (WebBundleDescriptor)getParentNode().getDescriptor();
        WebComponentDescriptor defaultServletDesc =
                descriptor.getWebComponentByCanonicalName("default");
        InitializationParameter initParam =
                getDefaultServletInitParam(defaultServletDesc, name, true);
        initParam.setValue(value);
    }
View Full Code Here

    }
           
    private static final String JSP_DESC = "glassfish.weblogic.jsp";
    private void setJspInitParameter(String property, String value) {

        WebComponentDescriptor jspDescriptor = getJspDescriptor(
                    (WebBundleDescriptor)getParentNode().getDescriptor());
        if (jspDescriptor != null) {
            // The description in the envior property is used as special
            // marker to indicate this jsp init is from weblogic.xml
            jspDescriptor.addInitializationParameter(
                new EnvironmentProperty(property, value, JSP_DESC));
        }
    }
View Full Code Here

    public Node writeDescriptor(Node parent, WebBundleDescriptor wbd) {

        ArrayList<InitializationParameter> jspInits =
                new ArrayList<InitializationParameter>();

        WebComponentDescriptor jspDescriptor = getJspDescriptor(wbd);
        if (jspDescriptor == null) {
            return null;
        }
        Enumeration e = jspDescriptor.getInitializationParameters();
        while (e.hasMoreElements()) {
            InitializationParameter initp =
                    (InitializationParameter)e.nextElement();
            if (JSP_DESC.equals(initp.getDescription())) {
                jspInits.add(initp);
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

            } 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

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.