Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.WebBundleDescriptor


            // Set webservice context here
            // If the endpoint has a WebServiceContext with @Resource then
            // that has to be used
            WebServiceContextImpl wsc = null;
            WebBundleDescriptor bundle = (WebBundleDescriptor)endpoint.getBundleDescriptor();
            Iterator<ResourceReferenceDescriptor> it = bundle.getResourceReferenceDescriptors().iterator();
            while(it.hasNext()) {
                ResourceReferenceDescriptor r = it.next();           
                if(r.isWebServiceContext()) {
                    Iterator<InjectionTarget> iter = r.getInjectionTargets().iterator();
                    boolean matchingClassFound = false;
                    while(iter.hasNext()) {
                        InjectionTarget target = iter.next();
                        if(endpoint.getServletImplClass().equals(target.getClassName())) {
                            matchingClassFound = true;
                            break;
                        }
                    }
                    if(!matchingClassFound) {
                        continue;
                    }
                    try {
                        javax.naming.InitialContext ic = new javax.naming.InitialContext();
                        wsc = (WebServiceContextImpl) ic.lookup("java:comp/env/" + r.getName());
                    } catch (Throwable t) {
                        // Do something here
                    }
                    if(wsc != null) {
                        wsc.setContextDelegate(context);
                        //needed to support isUserInRole() on WSC;
                        wsc.setServletName(bundle.getWebComponentDescriptorsSet());
                    }
                }
            }
        } catch (InjectionException ie) {
            throw new WebServiceException(ie);
View Full Code Here


                    }
                    //subModuleType
                    status.addProperty(key, String.valueOf(md.getModuleType().getValue()));

                    if (ModuleType.WAR.equals(md.getModuleType())) {
                        WebBundleDescriptor wbd =
                            (WebBundleDescriptor) md.getDescriptor();
                        key = subModuleID + sep + DeploymentStatus.CONTEXT_ROOT;
                        status.addProperty(key, getContextRoot(wbd)); //contextRoot
                    }
                    counter++;
                }

                key = moduleID + sep + DeploymentStatus.SUBMODULE_COUNT;
                status.addProperty(key, String.valueOf(counter)); //nums
            } else { //standalone module
                BundleDescriptor bd = app.getStandaloneBundleDescriptor();
                if (ModuleType.WAR.equals(bd.getModuleType())) {
                    WebBundleDescriptor wbd = (WebBundleDescriptor) bd;
                    key = moduleID + sep + DeploymentStatus.CONTEXT_ROOT;
                    status.addProperty(key, getContextRoot(wbd)); //contextRoot
                }
                // if extension modules have a context root
                if(XModuleType.isExtensionModule(bd.getModuleType())) {
                    if(bd instanceof WebBundleDescriptor) {
                        WebBundleDescriptor ebd = (WebBundleDescriptor) bd;
                        if(getContextRoot(ebd) != null) {
                            key = moduleID + sep + DeploymentStatus.CONTEXT_ROOT;
                            status.addProperty(key, getContextRoot(ebd));                       
                        }
                    }
View Full Code Here

                    }
                   
                    _logger.log(Level.FINEST, "[TomcatApplicationLoader] unload "
                                               +id);
                    wbds = application.getWebBundleDescriptors();
                    WebBundleDescriptor wbd = null;
                    if ( wbds == null) continue;

                    Iterator itr = wbds.iterator();
                   
                    while (itr.hasNext()){
                        wbd = (WebBundleDescriptor) itr.next();
                        String appName = wbd.getApplication().getRegistrationName();
                        try {
          webContainer.unloadWebModule(wbd.getContextRoot(),
                                                         appName,
                                                         virtualServers,
                                                         wbd);
                       
      } finally {
View Full Code Here

                    }
                    //subModuleType
                    status.addProperty(key, String.valueOf(md.getModuleType().getValue()));

                    if (ModuleType.WAR.equals(md.getModuleType())) {
                        WebBundleDescriptor wbd =
                            (WebBundleDescriptor) md.getDescriptor();
                        key = subModuleID + sep + DeploymentStatus.CONTEXT_ROOT;
                        status.addProperty(key, getContextRoot(wbd)); //contextRoot
                    }
                    counter++;
                }

                key = moduleID + sep + DeploymentStatus.SUBMODULE_COUNT;
                status.addProperty(key, String.valueOf(counter)); //nums
            } else { //standalone module
                BundleDescriptor bd = app.getStandaloneBundleDescriptor();
                if (ModuleType.WAR.equals(bd.getModuleType())) {
                    WebBundleDescriptor wbd = (WebBundleDescriptor) bd;
                    key = moduleID + sep + DeploymentStatus.CONTEXT_ROOT;
                    status.addProperty(key, getContextRoot(wbd)); //contextRoot
                }
                // if extension modules have a context root
                if(XModuleType.isExtensionModule(bd.getModuleType())) {
                    if(bd instanceof WebBundleDescriptor) {
                        WebBundleDescriptor ebd = (WebBundleDescriptor) bd;
                        if(getContextRoot(ebd) != null) {
                            key = moduleID + sep + DeploymentStatus.CONTEXT_ROOT;
                            status.addProperty(key, getContextRoot(ebd));                       
                        }
                    }
View Full Code Here

                appsManager.getRegisteredDescriptor(appName);
            // if the application already loaded on DAS
            if (application != null) {
                ArrayList contextRoots = new ArrayList();
                for (Iterator itr = application.getWebBundleDescriptors().iterator(); itr.hasNext();) {
                    WebBundleDescriptor wbd = (WebBundleDescriptor) itr.next();
                    contextRoots.add(wbd.getContextRoot());
                }
                return (String[])contextRoots.toArray(new String[contextRoots.size()]);
            // if not, read from disk
            } else {
                // load from generated/xml dir first
View Full Code Here

                appsManager.getRegisteredDescriptor(appName);
            // if the application already loaded on DAS
            if (application != null) {
                ArrayList contextRoots = new ArrayList();
                for (Iterator itr = application.getWebBundleDescriptors().iterator(); itr.hasNext();) {
                    WebBundleDescriptor wbd = (WebBundleDescriptor) itr.next();
                    contextRoots.add(wbd.getContextRoot());
                }
                return (String[])contextRoots.toArray(new String[contextRoots.size()]);
            // if not, read from disk
            } else {
                // load from generated/xml dir first
View Full Code Here

        endpoint.saveServletImplClass();

        WebComponentDescriptor webComp =
            (WebComponentDescriptor) endpoint.getWebComponentImpl();

        WebBundleDescriptor bundle = webComp.getWebBundleDescriptor();
        WebServicesDescriptor webServices = bundle.getWebServices();
        Collection endpoints =
            webServices.getEndpointsImplementedBy(webComp);

        if( endpoints.size() > 1 ) {
            String msg = "Servlet " + endpoint.getWebComponentLink() +
                " implements " + endpoints.size() + " web service endpoints " +
                " but must only implement 1";
            throw new IllegalStateException(msg);
        }

        if( endpoint.getEndpointAddressUri() == null ) {
            Set urlPatterns = webComp.getUrlPatternsSet();
            if( urlPatterns.size() == 1 ) {

                // Set endpoint-address-uri runtime info to uri.
                // Final endpoint address will still be relative to context root
                String uri = (String) urlPatterns.iterator().next();
                endpoint.setEndpointAddressUri(uri);

                // Set transport guarantee in runtime info if transport
                // guarantee is INTEGRAL or CONDIFIDENTIAL for any
                // security constraint with this url-pattern.
                Collection constraints =
                    bundle.getSecurityConstraintsForUrlPattern(uri);
                for(Iterator i = constraints.iterator(); i.hasNext();) {
                    SecurityConstraint next = (SecurityConstraint) i.next();
                       
                    UserDataConstraint dataConstraint =
                        next.getUserDataConstraint();
View Full Code Here

        Set webDescriptorSet = app.getWebBundleDescriptors() ;

        i = webDescriptorSet.iterator();
        while (i.hasNext()) {
            WebBundleDescriptor wbd = (WebBundleDescriptor)i.next();
            logger.finest("--[ Web module: " + wbd.getContextRoot() + " ]--");

            // login config
            LoginConfiguration lconf = wbd.getLoginConfiguration();
            if (lconf != null) {
                logger.finest("  Login config: realm="+
                              lconf.getRealmName() + ", method="+
                              lconf.getAuthenticationMethod() + ", form="+
                              lconf.getFormLoginPage() + ", error="+
                              lconf.getFormErrorPage());
            }

            // get WebComponentDescriptorsSet()  info
            logger.finest("  Contains components:");
            Set webComps = wbd.getWebComponentDescriptorsSet();
            Iterator webCompsIt = webComps.iterator();
            while (webCompsIt.hasNext()) {
                WebComponentDescriptor wcd =
                    (WebComponentDescriptor)webCompsIt.next();
                StringBuffer name = new StringBuffer();
                name.append("   - "+wcd.getCanonicalName());
                name.append(" [ ");
                Enumeration urlPs = wcd.getUrlPatterns();
                while (urlPs.hasMoreElements()) {
                    name.append(urlPs.nextElement().toString());
                    name.append(" ");
                }
                name.append("]");
                logger.finest(name.toString());
               
                RunAsIdentityDescriptor runas =
                    (RunAsIdentityDescriptor)wcd.getRunAsIdentity();
                if (runas!=null) {
                    String role = runas.getRoleName();
                    String user = runas.getPrincipal();
                    logger.finest("      Will run-as: Role: " + role +
                                  "  Principal: " + user);
                    if (role==null || "".equals(role) ||
                        user==null || "".equals(user)) {
                        logger.finest("*** Configuration error!");
                    }
                }
               
            }
           
            // security constraints
            logger.finest("  Security constraints:");
            Enumeration scEnum = wbd.getSecurityConstraints();
            while (scEnum.hasMoreElements()) {

                SecurityConstraintImpl sc =
                    (SecurityConstraintImpl)scEnum.nextElement();

View Full Code Here

            Object parentDesc = getParentNode().getDescriptor();
            if (parentDesc instanceof JndiNameEnvironment) {
                descriptor = ((JndiNameEnvironment) parentDesc).
                    getServiceReferenceByName(value);
            } else if (parentDesc instanceof SunWebApp) {
                WebBundleDescriptor desc = ((WebBundleRuntimeNode) getParentNode()).getWebBundleDescriptor();
                descriptor = desc.getServiceReferenceByName(value);
            }
        } else if (WebServicesTagNames.NAMESPACE_URI.equals(name)) {
            // Any service-qname set in standard DD takes precedence
            if( descriptor.getServiceNamespaceUri() == null ) {
                descriptor.setServiceNamespaceUri(value);
View Full Code Here

        } else if (bundleDesc instanceof ApplicationClientDescriptor) {
            ApplicationClientDescriptor appClientDesc =
                    (ApplicationClientDescriptor)bundleDesc;
            aeHandler = new AppClientContext(appClientDesc);
        } else if (bundleDesc instanceof WebBundleDescriptor) {
            WebBundleDescriptor webBundleDesc = (WebBundleDescriptor)bundleDesc;
            aeHandler = new WebBundleContext(webBundleDesc);
        }

        return aeHandler;
    }
View Full Code Here

TOP

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

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.