Package org.apache.geronimo.kernel.config

Examples of org.apache.geronimo.kernel.config.ConfigurationManager


    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException, IOException {
        String action = actionRequest.getParameter("action");
        actionResponse.setRenderParameter("message", ""); // set to blank first
        try {
            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
            String config = getConfigID(actionRequest);
            Artifact configId = Artifact.create(config);

            if (START_ACTION.equals(action)) {
                if(!configurationManager.isLoaded(configId)) {
                    configurationManager.loadConfiguration(configId);
                }
                if(!configurationManager.isRunning(configId)) {
                    configurationManager.startConfiguration(configId);
                    messageStatus = "Started application<br /><br />";
                }
            } else if (STOP_ACTION.equals(action)) {
                if(configurationManager.isRunning(configId)) {
                    configurationManager.stopConfiguration(configId);
                }
                if(configurationManager.isLoaded(configId)) {
                    configurationManager.unloadConfiguration(configId);
                    messageStatus = "Stopped application<br /><br />";
                }
            } else if (UNINSTALL_ACTION.equals(action)) {
                configurationManager.uninstallConfiguration(configId);
                messageStatus = "Uninstalled application<br /><br />";
            } else {
                messageStatus = "Invalid value for changeState: " + action + "<br /><br />";
                throw new PortletException("Invalid value for changeState: " + action);
            }
View Full Code Here


        if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
            return;
        }

        List moduleDetails = new ArrayList();
        ConfigurationManager configManager = ConfigurationUtil.getConfigurationManager(kernel);
        List infos = configManager.listConfigurations();
        for (Iterator j = infos.iterator(); j.hasNext();) {
            ConfigurationInfo info = (ConfigurationInfo) j.next();
            if (shouldListConfig(info)) {
                ModuleDetails details = new ModuleDetails(info.getConfigID(), info.getType(), info.getState());
View Full Code Here

        tmpbasedir.mkdirs();
        environment.setConfigId(configID);
        Jsr77Naming naming = new Jsr77Naming();
        ArtifactManager artifactManager = new DefaultArtifactManager();
        ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.EMPTY_SET, null);
        ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET, artifactResolver, Collections.EMPTY_SET);       
        context = new DeploymentContext(tmpbasedir, null, environment, ConfigurationModuleType.CAR, naming, configurationManager, Collections.EMPTY_SET);

        File moduleLocation = new File(tmpbasedir, "ejb");
        moduleLocation.mkdirs();
        AbstractName moduleName = naming.createRootName(configID, "testejb", NameFactory.EJB_MODULE);
View Full Code Here

        DownloadResults results = installer.install(new PluginList(new URL[]{repo, new URL("http://www.ibiblio.org/maven2/")},
                                                    new PluginMetadata[]{target}), null, null);
        if(results.isFailed()) {
            throw new ServletException("Unable to install sample application", results.getFailure());
        }
        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
        for (int i = 0; i < results.getInstalledConfigIDs().length; i++) {
            Artifact artifact = results.getInstalledConfigIDs()[i];
            if(mgr.isConfiguration(artifact)) {
                try {
                    if(!mgr.isLoaded(artifact)) {
                        mgr.loadConfiguration(artifact);
                    }
                    if(!mgr.isRunning(artifact)) {
                        mgr.startConfiguration(artifact);
                    }
                } catch (NoSuchConfigException e) {
                    throw new ServletException("Unable to start sample application", e);
                } catch (LifecycleException e) {
                    throw new ServletException("Unable to start sample application", e);
View Full Code Here

                localServer = new LocalServer("geronimo/j2ee-system//car", "var/config/offline-deployer-list");
            } catch (Exception e) {
                throw new DeploymentException("Could not start local server", e);
            }
            Kernel kernel = localServer.getKernel();
            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
            configurationManager.setOnline(false);

            manager = new LocalDeploymentManager(localServer.getKernel());
        } else {
            tryToConnect(uri, driver, user, password, true);
        }
View Full Code Here

            throw new DeploymentException(e);
        }

        DeploymentContext context = null;
        try {
            ConfigurationManager configurationManager = this.configurationManager;
            if (configurationManager == null) {
                configurationManager = new SimpleConfigurationManager(configurationStores, artifactResolver, repositories);
            }

            context = new DeploymentContext(outfile,
View Full Code Here

        this.modules = modules;
    }

    public void run() {
        try {
            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
            try {
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleID module = modules[i];

                    // Check to see whether the module is already started
                    Artifact moduleID = Artifact.create(module.getModuleID());
                    if (configurationManager.isRunning(moduleID)) {
                        updateStatus("Module " + moduleID + " is already running");
                        Thread.sleep(100);
                        continue;
                    }

                    // Load
                    if(!configurationManager.isLoaded(moduleID)) {
                        configurationManager.loadConfiguration(moduleID);
                    }

                    // Start
                    configurationManager.startConfiguration(moduleID);

                    // Determine the child modules of the configuration
                    //TODO might be a hack
                    List kids = loadChildren(kernel, moduleID.toString());
View Full Code Here

            Environment environment = EnvironmentBuilder.buildEnvironment(plan.getEnvironment());
            MockRepository mockRepository = new MockRepository();
            ArtifactManager artifactManager = new DefaultArtifactManager();
            ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.singleton(mockRepository), null);
            ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET, artifactResolver, Collections.EMPTY_SET);
            DeploymentContext context = new DeploymentContext(outFile, null, environment, ConfigurationModuleType.CAR, naming, configurationManager, Collections.singleton(mockRepository));
            AbstractName j2eeContext = naming.createRootName(environment.getConfigId(), environment.getConfigId().toString(), "Configuration");

            GbeanType[] gbeans = plan.getGbeanArray();
            ServiceConfigBuilder.addGBeans(gbeans, cl, j2eeContext, context);
View Full Code Here

        this.modules = modules;
    }

    public void run() {
        try {
            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
            try {
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];

                    Artifact moduleID = Artifact.create(module.getModuleID());
                    try {
                        configurationManager.stopConfiguration(moduleID);


                        configurationManager.unloadConfiguration(moduleID);
                        updateStatus("Module " + moduleID + " unloaded.");
                    } catch (InternalKernelException e) {
                        // this is cause by the kernel being already shutdown
                    } catch (NoSuchConfigException e) {
                        // module was already unloaded - just continue
                    }

                    try {
                        configurationManager.uninstallConfiguration(moduleID);
                        updateStatus("Module " + moduleID + " uninstalled.");
                        addModule(module);
                    } catch (NoSuchConfigException e) {
                        // module was already undeployed - just continue
                    }
View Full Code Here

        this.modules = modules;
    }

    public void run() {
        try {
            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
            try {
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleID module = modules[i];
                    Artifact moduleID = Artifact.create(module.getModuleID());
                    if(configurationManager.isRunning(moduleID)) {
                        configurationManager.stopConfiguration(moduleID);
                    }
                    if(configurationManager.isLoaded(moduleID)) {
                        configurationManager.unloadConfiguration(moduleID);
                        addModule(module);
                    }
                }
            } finally {
                ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.config.ConfigurationManager

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.