Package com.sun.enterprise.config.serverbeans

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


    public ModuleType getModuleType() {
        return ModuleType.WAR;
    }   

    private WebModule getWebModule(String modId) throws ConfigException {
        WebModule mod = (WebModule)
            ((Applications)this.configBean).getWebModuleByName(modId);
       
        if(mod == null)
            throw new ConfigException(Localizer.getValue(ExceptionType.NO_SUCH_WEB_MOD));
       
View Full Code Here


        }
        return arr;
    }
   
    public void remove(String modId) throws ConfigException {
        WebModule backEm = (WebModule)
            ((Applications)configBean).getWebModuleByName(modId);
        ((Applications)configBean).removeWebModule(backEm);
    }
View Full Code Here

     * Checks whether this module is a systemmodule
     * ResourceType in domain.xml should start with "system-"
     * @return true if resourceType starts with "system-"
     */    
    public boolean isSystem(String modIdthrows ConfigException{
        WebModule wm =  getWebModule(modId);
        String resourceType = wm.getObjectType();
        if(resourceType.startsWith(SYSTEM_PREFIX))
            return true;
        else
            return false;
    }
View Full Code Here

     * Checks whether this module is a system admin module
     * ResourceType in domain.xml should start with "system-admin"
     * @return true if resourceType starts with "system-admin"
     */
    public boolean isSystemAdmin(String modIdthrows ConfigException{
        WebModule wm =  getWebModule(modId);
        String resourceType = wm.getObjectType();
        if(resourceType.startsWith(SYSTEM_ADMIN_PREFIX))
            return true;
        else
            return false;
    }
View Full Code Here

     * ResourceType in domain.xml should start with "system"
     * Also it should be directory deployed
     * @return true if its a predeployed system module
     */
    public boolean isSystemPredeployed (String modIdthrows ConfigException{
        WebModule wm =  getWebModule(modId);
        String resourceType = wm.getObjectType();
        boolean isDirectoryDeployed = wm.isDirectoryDeployed();
        if (resourceType.startsWith(SYSTEM_PREFIX) && isDirectoryDeployed) {
            return true;
        } else {
            return false;
        }
View Full Code Here

     * @param optionalAttributes - pairs tag/value to set
     */
    public void setOptionalAttributes(String modId, Properties optionalAttributes)
            throws ConfigException {
        if(optionalAttributes!=null) {
            WebModule wm = getWebModule(modId);
            Enumeration tags = optionalAttributes.keys();
            while(tags.hasMoreElements())
            {
                String tag = (String)tags.nextElement();
                String value = optionalAttributes.getProperty(tag);
                wm.setAttributeValue(tag, value);
            }
        }
    }
View Full Code Here

            }
        }
    }
   
    public String getLocation(String name) throws ConfigException {
        WebModule webModule = (WebModule)
            ((Applications)this.configBean).getWebModuleByName(name);
        String location = null;
        if (webModule != null)
            location = webModule.getLocation();
        return resolvePath(location);
    }
View Full Code Here

            location = webModule.getLocation();
        return resolvePath(location);
    }

    public void setLocation(String name, String location) throws ConfigException {
        WebModule webModule = (WebModule)
            ((Applications)this.configBean).getWebModuleByName(name);
        if (webModule != null)
            webModule.setLocation(location);
    }
View Full Code Here

    }
    private void moduleDeployed(ConfigContext config, String moduleName)
            throws AdminEventListenerException {

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

        //Do not deploy if enable is false
        if (!isEnabled(config, 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);
        List<Throwable> throwables =
            getWebContainer().loadWebModule(wmInfo, "null");
        if (throwables != null && !throwables.isEmpty()) {
View Full Code Here

    
        
    private void moduleUndeployed(ConfigContext config, String moduleName)
            throws AdminEventListenerException {

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

        String appName = null;
        WebBundleDescriptor wbd;
        try {
      Application app = getWebModulesManager().getDescriptor(
                webModule.getName(), webModule.getLocation());
            RoleMapper.removeRoleMapper(app.getRoleMapper().getName());
            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

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.