Package org.apache.geronimo.kernel.config

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


        for (Iterator i = configLists.iterator(); i.hasNext();) {
            AbstractName configListName = (AbstractName) i.next();
            configs.addAll((List<Artifact>) kernel.invoke(configListName, "restore"));
        }
       
        ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
        try {
            for (Artifact config : configs) {
                configurationManager.loadConfiguration(config);
                configurationManager.startConfiguration(config);
            }
        } finally {
            ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
        }
    }
View Full Code Here


            if(configID != null && configID.getGroupId() == null) {
                configID = new Artifact(Artifact.DEFAULT_GROUP_ID, configID.getArtifactId(),
                                        configID.getVersion(), configID.getType());
            }

            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
            try {
                for (int i = 0; i < modules.length; i++) {
                    TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];
                    Artifact artifact = Artifact.create(module.getModuleID());
                    if(configID != null && configID.isResolved()) {
View Full Code Here

            monitor.foundModules((Artifact[]) configs.toArray(new Artifact[configs.size()]));

            // load the rest of the configurations
            try {
                ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
                try {
                    for (Iterator i = configs.iterator(); i.hasNext();) {
                        Artifact configID = (Artifact) i.next();
                        monitor.moduleLoading(configID);
                        configurationManager.loadConfiguration(configID);
                        monitor.moduleLoaded(configID);
                        monitor.moduleStarting(configID);
                        configurationManager.startConfiguration(configID);
                        monitor.moduleStarted(configID);
                    }
                } finally {
                    ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
                }
View Full Code Here

    }

    private boolean produceDownloadFile(Kernel kernel, Artifact configId, HttpServletResponse response, boolean reply) throws IOException {
        //todo: replace kernel mumbo jumbo with JSR-77 navigation
        // Step 1: check if it's in a configuration store
        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
        if(mgr.isConfiguration(configId)) {
            ConfigurationStore store = mgr.getStoreForConfiguration(configId);
            response.setContentType("application/zip");
            if(!reply) {
                return true;
            }
            try {
View Full Code Here

    }

    private void generateConfigFile(HttpServletRequest request, Kernel kernel, PrintWriter out) throws NoSuchStoreException, JAXBException, XMLStreamException {
        String repo = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+request.getServletPath();
        if(!repo.endsWith("/")) repo += "/";
        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
        PluginInstaller installer = getInstaller(kernel);
        PluginListType pluginList = installer.createPluginListForRepositories(repo);
        PluginXmlUtil.writePluginList(pluginList, out);
    }
View Full Code Here

        }
        return (PluginInstaller) kernel.getProxyManager().createProxy((AbstractName) names.iterator().next(), PluginInstaller.class);
    }

    private void generateMavenFile(Kernel kernel, PrintWriter writer, String groupId, String artifactId, boolean reply) throws ParserConfigurationException, TransformerException {
        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
        Artifact[] artifacts = mgr.getArtifactResolver().queryArtifacts(new Artifact(groupId, artifactId, (Version)null, null));
        if(!reply) {
            return;
        }

        DocumentBuilderFactory factory = XmlUtil.newDocumentBuilderFactory();
View Full Code Here

            actionResponse.setRenderParameter(MODE_KEY, SELECT_TYPE_MODE);
        } else if (mode.equals("process-" + SELECT_TYPE_MODE)) {
            if (data.getName() != null && !data.getName().trim().equals("")) {
                // Check if realm with the same name already exists
                Artifact artifact = new Artifact("console.realm", getArtifactId(data.getName()), "1.0", "car");
                ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(PortletManager.getKernel());
                if (configurationManager.isInstalled(artifact)) {
                    actionResponse.setRenderParameter(MODE_KEY, SELECT_TYPE_MODE);
                    String error = getLocalizedString(actionRequest, "plugin.errorMsg03");
                    addErrorMessage(actionRequest, error);
                } else {
                    // Config properties have to be set in render since they have values of null
View Full Code Here

        // The array entry types are security.realm.SecurityRealm (the subclass)
        org.apache.geronimo.management.geronimo.SecurityRealm[] realms = PortletManager.getCurrentServer(request).getSecurityRealms();
        ExistingRealm[] results = new ExistingRealm[realms.length];

        // ConfigurationManager is used to determine if the SecurityRealm is deployed as a "SERVICE", i.e., "Server-wide"
        ConfigurationManager configMgr = null;
        if(results.length > 0) {
            // Needed only when there are any SecurityRealms
            configMgr = ConfigurationUtil.getConfigurationManager(kernel);
        }
        for (int i = 0; i < results.length; i++) {
            AbstractName abstractName = PortletManager.getNameFor(request, realms[i]);
            String parent;
            Configuration parentConfig = configMgr.getConfiguration(abstractName.getArtifact());
            ConfigurationModuleType parentType = parentConfig.getModuleType();
            if(ConfigurationModuleType.SERVICE.equals(parentType)) {
                parent = null; // Server-wide
            } else {
                parent = abstractName.getArtifact().toString();
View Full Code Here

                }
            }
            if (!found) {
                throw new GBeanNotFoundException(connectorName);
            }
            ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
            if (mgr != null && mgr instanceof EditableConfigurationManager) {
                try {
                   ((EditableConfigurationManager)mgr).removeGBeanFromConfiguration(connectorName.getArtifact(), connectorName);
                } catch (InvalidConfigException e) {
                    log.error("Unable to add GBean", e);
View Full Code Here

            AbstractNameQuery query = new AbstractNameQuery(KeystoreManager.class.getName());
            gbeanData.setReferencePattern("KeystoreManager", query);
        }
       
        try {
            ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
            if (mgr != null && mgr instanceof EditableConfigurationManager) {
                ((EditableConfigurationManager)mgr).addGBeanToConfiguration(containerName.getArtifact(), gbeanData, false);
            } else {
                log.warn("The ConfigurationManager in the kernel does not allow editing");
                return null;
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.