Package com.sun.enterprise.config.serverbeans

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


        try {
            apps = ServerBeansFactory.getApplicationsBean(ctx);               
        } catch (Exception e) {
            return null;
        }
        J2eeApplication app = apps.getJ2eeApplicationByName(appName);
           
        if (app == null )
            return null;
           
        if (__logger.isLoggable(Level.FINE)) {
            __logger.fine("The application load event for  "  + appName);
        }
           
        String loc = app.getLocation();
           
        //Try to retrieve the loader listener classname from manifest.
        Manifest mf = EJBClassPathUtils.getManifest(loc);

        String loaderListener = null;
View Full Code Here


       
        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();
View Full Code Here

            separatorIndex = id.indexOf('#');
        }
        if (separatorIndex != -1) {
            String appID = id.substring(0, separatorIndex);
            String moduleID = id.substring(separatorIndex + 1);
            J2eeApplication j2eeApp = appsBean.getJ2eeApplicationByName(appID);
            if ((j2eeApp != null) && j2eeApp.isEnabled()) {
                String location = j2eeApp.getLocation();
                String moduleDir =
                    DeploymentUtils.getRelativeEmbeddedModulePath(
                        location, moduleID);
             
                ApplicationRegistry registry =
                    ApplicationRegistry.getInstance();
                ClassLoader appLoader =
                    registry.getClassLoaderForApplication(appID);
                if (appLoader != null) {
                    Application appDesc = registry.getApplication(appLoader);
                    if (appDesc != null) {
                        Set wbds = appDesc.getWebBundleDescriptors();
                        WebBundleDescriptor wbd = null;
                        for (Iterator itr = wbds.iterator(); itr.hasNext(); ) {
                            wbd = (WebBundleDescriptor) itr.next();
                            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);
                                wmInfo.setVirtualServers(vsList);
View Full Code Here

     * @param moduleId The module id of the J2EE application
     * @return A comma separated list representing the libraries
     * specified by the deployer.
     */
    public static String getLibrariesForJ2EEApplication(String moduleId) {
        J2eeApplication app = null;
        try {
            app = getApplications().getJ2eeApplicationByName(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);           
        }
        return app.getLibraries();
    }
View Full Code Here

        }
        return returnValue;       
    }   
   
    private J2eeApplication getJ2eeApplicationByName(String appName) {
        J2eeApplication result = null;
        Applications applicationsBean = this.getApplicationsBeanDynamic();
        if(applicationsBean == null) {
            return null;
        }
        return applicationsBean.getJ2eeApplicationByName(appName);
View Full Code Here

        }
        return applicationsBean.getJ2eeApplicationByName(appName);
    }
   
    private boolean getJ2eeApplicationAvailability(String appName, boolean inheritedValue) {
        J2eeApplication j2eeApp =
            this.getJ2eeApplicationByName(appName);
        if(_logger.isLoggable(Level.FINEST)) {
            _logger.finest("ServerConfigLookup>>getJ2eeApplicationAvailability j2eeApp = " + j2eeApp);
        }
        if(j2eeApp == null) {
            return false;
        }
        return j2eeApp.isAvailabilityEnabled();
    }   
View Full Code Here

        if(_logger.isLoggable(Level.FINEST)) {
            _logger.finest("webContainerAvailability = " + webContainerAvailability);
        }       

        boolean webModuleAvailability = false;
        J2eeApplication j2eeApp = ctx.getApplicationBean();
        if (j2eeApp == null) {
            // the stand-alone web module case
            ConfigBean bean = ctx.getBean();
            if (bean instanceof com.sun.enterprise.config.serverbeans.WebModule) {
                webModuleAvailability = ((com.sun.enterprise.config.serverbeans.WebModule) bean).isAvailabilityEnabled();
            } else {
                webModuleAvailability = ((com.sun.enterprise.config.serverbeans.ExtensionModule) bean).isAvailabilityEnabled();
            }
        } else {
            // the j2ee application case
            webModuleAvailability = j2eeApp.isAvailabilityEnabled();
        }

        if(_logger.isLoggable(Level.FINEST)) {
            _logger.finest("webModuleAvailability = " + webModuleAvailability);
        }
View Full Code Here

        }       
        return arr;
    }
   
    public String getLocation(String appId) throws ConfigException {
        J2eeApplication app = (J2eeApplication) getJ2eeApplication(appId);
        InstanceEnvironment instEnv;
        if ((instEnv = getInstanceEnvironment()) == null) {
            throw new ConfigException("instEnv was null");
        }
        PropertyResolver resolver = new PropertyResolver(super.configContext,
                instEnv.getName());
        String appLocation;
        if ((appLocation = app.getLocation()) == null) {
            throw new ConfigException("appLocation was null");
        };
        String resolvedPath = resolver.resolve(appLocation);
        return resolvedPath;
       
View Full Code Here

     * Checks whether this application is a system app
   * ResourceType in domain.xml should start with "system-"
     * @return true if resourceType starts with "system-"
     */
  public boolean isSystem(String appId) throws ConfigException {
     J2eeApplication ja = getJ2eeApplication(appId);
     String resourceType = ja.getObjectType();
     if(resourceType.startsWith(SYSTEM_PREFIX))
         return true;
     else
         return false;
  }
View Full Code Here

     * Checks whether this application is a system admin app
         * ResourceType in domain.xml should start with "system-admin"
     * @return true if resourceType starts with "system-admin"
     */
        public boolean isSystemAdmin(String appId) throws ConfigException {
           J2eeApplication ja = getJ2eeApplication(appId);
           String resourceType = ja.getObjectType();
           if(resourceType.startsWith(SYSTEM_ADMIN_PREFIX))
               return true;
           else
               return false;
        }
View Full Code Here

TOP

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

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.