Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.WebModule


                    "[WebModuleDeployEventListener] Handling event " + event.toString());
            }
            ConfigContext config = event.getConfigContext();
            String moduleName = event.getModuleName();

            WebModule webModule = getWebModuleAndUpdateCache(
                config, moduleName, true);

            //Do not deploy if enable is false
            if (!isEnabled(event.getConfigContext(), moduleName)) {
                return;
            }

            String location = webModule.getLocation();
            // If module root is relative then prefix it with the
            // location of where all the standalone modules for
            // this server instance are deployed
            File moduleBase = new File(location);
            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


                    "[WebModuleDeployEventListener] Handling event " + event.toString());
            }
            ConfigContext config = event.getConfigContext();
            String moduleName = event.getModuleName();

            WebModule webModule = getWebModuleAndUpdateCache(
                config, moduleName, true);

            String appName = null;
            WebBundleDescriptor wbd;
            try {
                Application app = getWebModulesManager().getDescriptor(
                    webModule.getName(), webModule.getLocation());
                wbd =
                    (WebBundleDescriptor) app.getStandaloneBundleDescriptor();
                appName = app.getRegistrationName();
            } catch (ConfigException ce) {
                throw new AdminEventListenerException(ce);
            }
            String contextRoot = webModule.getContextRoot();
            String virtualServers = null;
            try {
                virtualServers = ServerBeansFactory
                                .getVirtualServersByAppName(config,moduleName);
            } catch(ConfigException ce) {
View Full Code Here

    }

    private synchronized WebModule getWebModuleAndUpdateCache(
        ConfigContext config, String moduleName, boolean isAddToCache)
        throws AdminEventListenerException {
        WebModule webModule = (WebModule)cachedWebModules.get(moduleName);
        if ( webModule  == null ) {
            try {
              webModule = (WebModule) ApplicationHelper.findApplication(
                  config, moduleName);
            } catch (ConfigException ce) {
View Full Code Here

        if (appsBean != null) {
            WebModule[] wmBeans = appsBean.getWebModule();
            if (wmBeans != null && wmBeans.length > 0) {
                for (int i = 0; i < wmBeans.length; i++) {
                    WebModule wm = wmBeans[i];
                    if (isActive(wm)) {                     
                        // skips if the web module is not referenced by
                        // this server
                        ApplicationRef ref =
                            serverBean.getApplicationRefByRef(wm.getName());
                        if (ref == null) {
                            continue;
                        }                      

                        String location = wm.getLocation();
                        // If module root is relative then prefix it with the
                        // location of where all the standalone modules for
                        // this server instance are deployed
                        File moduleBase = new File(location);
                        if (!moduleBase.isAbsolute()) {
                            location = modulesRoot+File.separator+location;
                            wm.setLocation(location);
                        }
                        WebModuleConfig wmInfo = loadWebModuleConfig(wm);
                        if (wmInfo != null)
                            modules.add(wmInfo);
                    } else {
                        if (_debug) {
                            _logger.finer("Web Module [" + wm.getName() +
                                          "] is not applicable for virtual " +
                                          " server [" + getID() + "]");
                        }
                    }
                }
View Full Code Here

            // j2ee-application
            WebModuleConfig wmInfo = findWebModuleInJ2eeApp(appsBean, wmID);

            // Look up the list of standalone web modules
            if (wmInfo == null) {
                WebModule wm = appsBean.getWebModuleByName(wmID);
                if (wm != null) {
                    if (isActive(wm, false)) {
                        // Create a copy as we need to change the name
                        // and context root to indicate that this web module
                        // is to be loaded as the 'default' web module for
                        // the virtual server
                        // WebModule wmCopy = (WebModule) wm.clone();
                        contextRoot = wm.getContextRoot();
                    } else {
                        Object[] params = { wmID, getID() };
                        _logger.log(Level.SEVERE, "vs.defaultWebModuleDisabled",
                                    params);
                    }
View Full Code Here

        //
        String docroot = getAppBase();
        if (getDefaultWebModuleID() == null && (findChild("") == null)
                && (docroot != null)) {
            wmInfo = new WebModuleConfig();
            WebModule wm = new WebModule();
            wm.setName(Constants.DEFAULT_WEB_MODULE_NAME);
            wm.setContextRoot("");
            wm.setLocation(docroot);
            wmInfo.setBean(wm);
           
            wmInfo.setDescriptor(DOLLoadingContextFactory.getDefaultWebBundleDescriptor());
            WebBundleDescriptor wbd = wmInfo.getDescriptor();
View Full Code Here

                            String webUri = wbd.getModuleDescriptor().getArchiveUri();
                            if (moduleID.equals(webUri)) {
                                StringBuffer dir = new StringBuffer(location);
                                dir.append(File.separator);
                                dir.append(moduleDir);
                                WebModule wm = new WebModule();
                                wm.setName(moduleID);
                                wm.setContextRoot(wbd.getContextRoot());
                                wm.setLocation(dir.toString());
                                wm.setEnabled(true);
                                String vsList = getVirtualServers(j2eeApp.getName());
                                wmInfo = new WebModuleConfig();
                                wmInfo.setBean(wm);
                                wmInfo.setDescriptor(wbd);
                                wmInfo.setParentLoader(appLoader);
View Full Code Here

     * @param moduleId The module id of the web module
     * @return A comma separated list representing the libraries
     * specified by the deployer.
     */
    public static String getLibrariesForWebModule(String moduleId) {
        WebModule app = null;
        try {
            app = getApplications().getWebModuleByName(moduleId);
            if(app == null) return null;
        } catch(ConfigException malEx) {
            _logger.log(Level.WARNING, "loader.cannot_convert_classpath_into_url",
                                                                                           moduleId);
            _logger.log(Level.WARNING,"loader.exception", malEx);           
        }

        String librariesStr  = app.getLibraries();
        if (_logger.isLoggable(Level.FINE)) {
            _logger.log(Level.FINE, "app = " +  app + " library = " + librariesStr);
        }
        return librariesStr;
    }
View Full Code Here

                app.addElementProperty(extManagedProperty);
            } else if (appBean instanceof EjbModule) {
                EjbModule app = (EjbModule) appBean;
                app.addElementProperty(extManagedProperty);
            } else if (appBean instanceof WebModule) {
                WebModule app = (WebModule) appBean;
                app.addElementProperty(extManagedProperty);
            } else if (appBean instanceof AppclientModule) {
                AppclientModule app = (AppclientModule) appBean;
                app.addElementProperty(extManagedProperty);
            } else if (appBean instanceof ConnectorModule) {
                ConnectorModule app = (ConnectorModule) appBean;
                app.addElementProperty(extManagedProperty);
            }
        }
       
        // Set the context root on the extension module as a property
        if(appBean instanceof ExtensionModule) {
View Full Code Here

                } else if (appBean instanceof EjbModule) {
                    EjbModule app = (EjbModule) appBean;
                    extManagedProperty =
                        app.getElementPropertyByName(EXTERNALLY_MANAGED);
                } else if (appBean instanceof WebModule) {
                    WebModule app = (WebModule) appBean;
                    extManagedProperty =
                        app.getElementPropertyByName(EXTERNALLY_MANAGED);
                } else if (appBean instanceof AppclientModule) {
                    AppclientModule app = (AppclientModule) appBean;
                    extManagedProperty =
                        app.getElementPropertyByName(EXTERNALLY_MANAGED);
                } else if (appBean instanceof ConnectorModule) {
                    ConnectorModule app = (ConnectorModule) appBean;
                    extManagedProperty =
                        app.getElementPropertyByName(EXTERNALLY_MANAGED);
                }
                                                                               
                if (extManagedProperty != null) {
                    return Boolean.valueOf(
                        extManagedProperty.getValue()).booleanValue();
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.WebModule

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.