Package com.sun.enterprise.config.serverbeans

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


                              StringValidator.getInstance()); //noi18n
        try
        {
            sLogger.log(Level.FINEST, "mbean.delete_lifecycle", moduleName);
            ConfigContext serverContext = getConfigContext(mInstanceName);
            Applications applicationsConfigBean =
                (Applications) ConfigBeansFactory.getConfigBeanByXPath(
                    serverContext,
                    ServerXPathHelper.XPATH_APPLICATIONS);
            LifecycleModule module =
                applicationsConfigBean.getLifecycleModuleByName(moduleName);
            applicationsConfigBean.removeLifecycleModule(module);
            deleteResourceRef(moduleName);
            serverContext.flush();
        }
        catch (Exception e)
        {
View Full Code Here


        String[] modules = new String[0];
        try
        {
            sLogger.log(Level.FINEST, "mbean.list_components");
            ConfigContext serverContext = getConfigContext(mInstanceName);
            Applications applicationsConfigBean =
                (Applications) ConfigBeansFactory.getConfigBeanByXPath(
                    serverContext,
                    ServerXPathHelper.XPATH_APPLICATIONS);
            LifecycleModule[] lifecycleConfigBeans =
                applicationsConfigBean.getLifecycleModule();
            if ((lifecycleConfigBeans != null) &&
                (lifecycleConfigBeans.length > 0))
            {
                modules = new String[lifecycleConfigBeans.length];
                for (int i = 0; i < lifecycleConfigBeans.length; i++)
View Full Code Here

        String clientJarLocation = null;
        try
        {
            ConfigContext serverContext = getConfigContext(mInstanceName);
            InstanceEnvironment iEnv = new InstanceEnvironment(mInstanceName);
            Applications applicationsConfigBean =
                (Applications) ConfigBeansFactory.getConfigBeanByXPath(
                    serverContext, ServerXPathHelper.XPATH_APPLICATIONS);
            String appLocation = null;
            switch (appType)
            {
                case DeploymentConstants.EAR :
                    J2eeApplication app = applicationsConfigBean.
                                            getJ2eeApplicationByName(appName);
                    AppsManager appsManager = new AppsManager(iEnv);
                    appLocation = appsManager.getGeneratedXMLLocation(appName);

                    // for upgrade scenario, we fall back to the original
                    // location
                    if (appLocation == null ||
                        !FileUtils.safeIsDirectory(appLocation)) {
                        appLocation = app.getLocation();
                    }
                    break;
                case DeploymentConstants.EJB :
                    EjbModule module = applicationsConfigBean.
                                            getEjbModuleByName(appName);
                    EjbModulesManager ejbManager = new EjbModulesManager(iEnv);
                    appLocation = ejbManager.getGeneratedXMLLocation(appName);

                    // for upgrade scenario, we fall back to the original
View Full Code Here

        String wsdlFileLocation = null;
        try
        {
            ConfigContext serverContext = getConfigContext(mInstanceName);
            InstanceEnvironment iEnv = new InstanceEnvironment(mInstanceName);
            Applications applicationsConfigBean =
                (Applications) ConfigBeansFactory.getConfigBeanByXPath(
                    serverContext, ServerXPathHelper.XPATH_APPLICATIONS);
            String appLocation = null;
            AbstractArchive moduleArchive = null;
            switch (appType)
            {
                case DeploymentConstants.EAR :
                    AppsManager appsManager = new AppsManager(iEnv);
                    appLocation = appsManager.getGeneratedXMLLocation(appName);
                    if (appLocation == null || !FileUtils.safeIsDirectory(appLocation)) {
                        J2eeApplication app = applicationsConfigBean.
                                            getJ2eeApplicationByName(appName);
                        appLocation = app.getLocation();
                    }
                    break;
                case DeploymentConstants.EJB :
                    EjbModulesManager ejbManager = new EjbModulesManager(iEnv);
                    appLocation = ejbManager.getGeneratedXMLLocation(appName);
                    if (appLocation == null || !FileUtils.safeIsDirectory(appLocation)) {
                        EjbModule module = applicationsConfigBean.
                                            getEjbModuleByName(appName);
                        appLocation = module.getLocation();
                    }
                    break;
                case DeploymentConstants.WAR:
                    WebModulesManager webManager = new WebModulesManager(iEnv);
                    appLocation = webManager.getGeneratedXMLLocation(appName);
                    if (appLocation == null || !FileUtils.safeIsDirectory(appLocation)) {
                        WebModule webModule = applicationsConfigBean.
                                            getWebModuleByName(appName);
                        appLocation = webModule.getLocation();
                    }
                    break;
            }
View Full Code Here

    {
        ConfigBean appConfigBean = null;
        try
        {
            ConfigContext serverContext = super.getConfigContext();
            Applications applicationsConfigBean =
                (Applications) ConfigBeansFactory.getConfigBeanByXPath(
                                    serverContext,
                                    ServerXPathHelper.XPATH_APPLICATIONS);
            if (applicationsConfigBean != null)
            {
                switch (appType)
                {
                    case DeploymentConstants.EAR :
                    {
                        appConfigBean = applicationsConfigBean.
                                            getJ2eeApplicationByName(appName);
                        break;
                    }
                    case DeploymentConstants.EJB :
                    {
                        appConfigBean = applicationsConfigBean.
                                            getEjbModuleByName(appName);
                        break;
                    }
                    case DeploymentConstants.WAR :
                    {
                        appConfigBean = applicationsConfigBean.
                                            getWebModuleByName(appName);
                        break;
                    }
                    case DeploymentConstants.RAR :
                    {
                        appConfigBean = applicationsConfigBean.
                                            getConnectorModuleByName(appName);
                        break;
                    }
                }
            }
View Full Code Here

    {
        ConfigBean moduleConfigBean = null;
        try
        {
            ConfigContext serverContext = super.getConfigContext();
            Applications applicationsConfigBean =
                (Applications) ConfigBeansFactory.getConfigBeanByXPath(
                                    serverContext,
                                    ServerXPathHelper.XPATH_APPLICATIONS);
            if (applicationsConfigBean != null)
            {
                if (moduleType.equals(ModuleType.EAR))
                {
                    moduleConfigBean = applicationsConfigBean.
                                        getJ2eeApplicationByName(moduleName);
    } else
                if (moduleType.equals(ModuleType.EJB))
                {
                        moduleConfigBean = applicationsConfigBean.
                                            getEjbModuleByName(moduleName);
    } else
                if (moduleType.equals(ModuleType.WAR))
                {
                        moduleConfigBean = applicationsConfigBean.
                                            getWebModuleByName(moduleName);
    } else
                if (moduleType.equals(ModuleType.RAR))
                {
                        moduleConfigBean = applicationsConfigBean.
                                            getConnectorModuleByName(moduleName);
    }
            }
        }
        catch (Exception e)
View Full Code Here

  }

    public static ConfigBean findApplication(ConfigContext configContext,
                   String appName) throws ConfigException
    {
        Applications root = ((Domain)configContext.getRootConfigBean()).
                                    getApplications();

        ConfigBean app = root.getJ2eeApplicationByName(appName);
        if ( app != null)
            return app;

        app = root.getEjbModuleByName(appName);
        if ( app != null)
            return app;

        app = root.getWebModuleByName(appName);
        if ( app != null)
            return app;

        app = root.getConnectorModuleByName(appName);
        if ( app != null)
            return app;
       
        app = root.getAppclientModuleByName(appName);
        if ( app != null)
            return app;

        app = root.getLifecycleModuleByName(appName);
        if ( app != null)
            return app;

        app = root.getMbeanByName(appName);
        if ( app != null)
            return app;

        app = root.getExtensionModuleByName(appName);
        if ( app != null)
            return app;

        return null;
    }
View Full Code Here

    public static String[] getApplicationsInDomain(ConfigContext configContext)
        throws ConfigException
    {
        ArrayList result = new ArrayList();
        final Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);
        final Applications applications = domain.getApplications();
        AppclientModule[] appclients = applications.getAppclientModule();
        for (int i = 0; i < appclients.length; i++) {
            result.add(appclients[i].getName());
        }
        ConnectorModule[] connectors = applications.getConnectorModule();
        for (int i = 0; i < connectors.length; i++) {
            result.add(connectors[i].getName());
        }
        EjbModule[] ebjs = applications.getEjbModule();
        for (int i = 0; i < ebjs.length; i++) {
            result.add(ebjs[i].getName());
        }
        J2eeApplication[] apps = applications.getJ2eeApplication();
        for (int i = 0; i < apps.length; i++) {
            result.add(apps[i].getName());
        }
        LifecycleModule[] lifecycles = applications.getLifecycleModule();
        for (int i = 0; i < lifecycles.length; i++) {
            result.add(lifecycles[i].getName());
        }
        WebModule[] webs = applications.getWebModule();
        for (int i = 0; i < webs.length; i++) {
            result.add(webs[i].getName());
        }
        Mbean[] mbeans = applications.getMbean();
        for (int i = 0; i < mbeans.length; i++) {
            result.add(mbeans[i].getName());
        }
        ExtensionModule[] extensionModules = applications.getExtensionModule();
        for (int i = 0; i < mbeans.length; i++) {
            result.add(mbeans[i].getName());
        }       
        return (String[])result.toArray(new String[result.size()]);
    }
View Full Code Here

                 *server restart.  In that case the config present in the appsManager
                 *or appClientModulesManager is current, so use that for the config.
                 */
                configContext = chooseManager().getConfigContext();
            }
            Applications apps = (Applications) ConfigBeansFactory.getConfigBeanByXPath(configContext,
                            ServerXPathHelper.XPATH_APPLICATIONS);
            return apps;
        }
View Full Code Here

    /**
    * Get the applications element from domain.xml.
    * return null if not found
    */    
    private Applications getApplicationsBean() {
        Applications applicationsBean = null;
        Domain domainBean = null;
        /*
        ServerContext serverCtx = ApplicationServer.getServerContext();
        ConfigContext configCtx = serverCtx.getConfigContext();
         */
 
View Full Code Here

TOP

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

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.