Package com.sun.enterprise.web

Examples of com.sun.enterprise.web.WebModuleConfig


     * @return WebModuleConfig
     */
    public WebModuleConfig getModuleConfig(ExtensionModule em,
                                                      WebBundleDescriptor wbd) {
       
        WebModuleConfig wmInfo = new WebModuleConfig();      
        wmInfo.setBean(em);
        String wmID = em.getName();
        try {
            wmInfo.setDescriptor(wbd);
            String vs = configManager.getVirtualServers(wmID);
            wmInfo.setVirtualServers(vs);
        } catch (Exception ce) {
            wmInfo = null;
        }
        return wmInfo;       
    }
View Full Code Here


     */
    public boolean loadJ2eeApplicationModule(ArchiveDescriptor descriptor)
                                                             throws Exception {
       
        com.sun.enterprise.config.serverbeans.ExtensionModule em = null;
        WebModuleConfig wmInfo = null;  
        Application appDesc = null;

        J2eeApplication j2eeAppBean = getJ2eeAppBean();
        ConfigContext eventConfigContext = j2eeAppBean.getConfigContext();
        String id = j2eeAppBean.getName();
        String location = j2eeAppBean.getLocation();
        String resourceType = j2eeAppBean.getObjectType()
       
        //TODO : Check if enabled and take action
       
        // get the application descriptor
        ApplicationRegistry registry = ApplicationRegistry.getInstance();
        ClassLoader appLoader = registry.getClassLoaderForApplication(id);
        if (appLoader != null) {
            appDesc = registry.getApplication(appLoader);
        }
        // If the Application object is null then we should not load.
        if(appDesc == null ) {
            // log message
            return false;
        }
        String j2eeApplication = appDesc.getRegistrationName();
       
        // get the Bundle Descriptor
        WebBundleDescriptor wbd = (WebBundleDescriptor)descriptor;
        String moduleName = wbd.getModuleDescriptor().getArchiveUri();
                           
        StringBuffer dir = new StringBuffer(location);
        dir.append(File.separator);
        dir.append(FileUtils.makeFriendlyFilename(moduleName));
        if (!(new File(dir.toString()).exists())) {
            dir = new StringBuffer(location).append(
                            File.separator).append(moduleName);
        }

        // set the values in the ExtensionModule config bean
        em = new com.sun.enterprise.config.serverbeans.ExtensionModule();
        em.setLocation(dir.toString().trim());
        em.setConfigContext(eventConfigContext);
        em.setName(moduleName);
        ElementProperty isConvergedProperty = new ElementProperty();
        isConvergedProperty.setName("isConverged");
        if(wbd.getContextRoot() != null) {
            isConvergedProperty.setValue("true");
            ElementProperty contextRootProperty = new ElementProperty();
            contextRootProperty.setName("contextRoot");
            contextRootProperty.setValue(wbd.getContextRoot());
            em.addElementProperty(contextRootProperty);
        } else {
            isConvergedProperty.setValue("false");
        }  
        em.addElementProperty(isConvergedProperty);
        em.setEnabled(true);
        em.setObjectType(resourceType);

        // create and populate the WebModuleConfig object
        wmInfo = new WebModuleConfig();
       
        wmInfo.setBean(em);
        wmInfo.setApplicationBean(j2eeAppBean);
        wmInfo.setDescriptor(wbd);
        wmInfo.setParentLoader(appLoader);
        wmInfo.setVirtualServers(getVirtualServers(id, eventConfigContext));
       
        // Call into the WebContainer
        List<Throwable> throwables =
                getWebContainer().loadWebModule(wmInfo, j2eeApplication);
        setJ2eeAppBean(null);
View Full Code Here

     *              deployment descriptors.
     */
    private WebModuleConfig loadWebModuleConfig(WebModule wm,
        ConfigContext config) {

        WebModuleConfig wmInfo = new WebModuleConfig();
        wmInfo.setBean(wm);
        String wmID = wm.getName();
        String location = wm.getLocation();
        try {
      Application app = getWebModulesManager().getDescriptor(wmID,
                location);
            WebBundleDescriptor wbd = (WebBundleDescriptor) app.getStandaloneBundleDescriptor();               
            wmInfo.setDescriptor(wbd);
            String vs = ServerBeansFactory.getVirtualServersByAppName(
                    config, wmID);
            wmInfo.setVirtualServers(vs);
        } catch (ConfigException ce) {
            wmInfo = null;
        }
        return wmInfo;
       
View Full Code Here

        String modulesRoot = getWebContainer().getModulesRoot();
        if (!moduleBase.isAbsolute()) {
            location = modulesRoot+File.separator+location;
            webModule.setLocation(location);
        }
        WebModuleConfig wmInfo = loadWebModuleConfig(webModule, config);
        List<Throwable> throwables =
            getWebContainer().loadWebModule(wmInfo, "null");
        if (throwables != null && !throwables.isEmpty()) {
            //we don't have the ability to return all errors.  so return the
            //first one, enough to signal the problem.
View Full Code Here

            String modulesRoot = getWebContainer().getModulesRoot();
            if (!moduleBase.isAbsolute()) {
                location = modulesRoot+File.separator+location;
                webModule.setLocation(location);
            }
            WebModuleConfig wmInfo = loadWebModuleConfig(webModule, config);
            getWebContainer().enableWebModule(wmInfo, "null");
        }
       
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.web.WebModuleConfig

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.