Package org.apache.geronimo.kernel.config

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


            getModuleClasspath(classpath, module.getRootEarContext());
        }        
    }

    private static void getModuleClasspath(StringBuilder classpath, DeploymentContext deploymentContext) throws DeploymentException {
        Configuration configuration = deploymentContext.getConfiguration();
        ConfigurationResolver resolver = configuration.getConfigurationResolver();
        List<String> moduleClassPath = configuration.getClassPath();
        for (String pattern : moduleClassPath) {
            try {
                Set<URL> files = resolver.resolve(pattern);
                for (URL url: files) {
                    String path = toFileName(url);
View Full Code Here


            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

            Artifact configurationId = configurationData.getId();

            // load the configuration
            configurationManager.loadConfiguration(configurationData);
            Configuration configuration = configurationManager.getConfiguration(configurationId);
            configurationManager.startConfiguration(configurationId);
            Set<AbstractName> gb = configuration.getGBeans().keySet();
            for (AbstractName name : gb) {
                if (State.RUNNING_INDEX != kernel.getGBeanState(name)) {
                    log.debug("Not running: " + name);
                }
            }
View Full Code Here

        return destination;
    }


    private ResourceReferenceFactory<RuntimeException> buildAdminObjectReference(Module module, AbstractNameQuery containerId, Class iface) throws DeploymentException {
        Configuration localConfiguration = module.getEarContext().getConfiguration();
        try {
            localConfiguration.findGBean(containerId);
        } catch (GBeanNotFoundException e) {
            throw new DeploymentException("Can not resolve admin object ref " + containerId + " in configuration " + localConfiguration.getId(), e);
        }
        return new ResourceReferenceFactory<RuntimeException>(module.getConfigId(), containerId, iface);
    }
View Full Code Here

                AbstractName jndiContextName = earContext.getNaming().createChildName(appClientDeploymentContext.getModuleName(), "StaticJndiContext", "StaticJndiContext");
                GBeanData jndiContextGBeanData = new GBeanData(jndiContextName, StaticJndiContextPlugin.GBEAN_INFO);
                try {
                    Map<NamingBuilder.Key, Object> buildingContext = new HashMap<NamingBuilder.Key, Object>();
                    buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, jndiContextName);
                    Configuration localConfiguration = appClientDeploymentContext.getConfiguration();
                    Configuration remoteConfiguration = earContext.getConfiguration();

                    if (!appClient.getMetadataComplete()) {
                        // Create a classfinder and populate it for the naming builder(s). The absence of a
                        // classFinder in the module will convey whether metadata-complete is set
                        // (or not)
View Full Code Here

            return new ConfigurationStore[]{store};
        }

        public Configuration getConfiguration(Artifact configurationId) {
            try {
                return new Configuration(Collections.EMPTY_SET, loadedConfigurationData, new ConfigurationResolver(configurationId, dir), null);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

        thread.setContextClassLoader( context.getConfiguration().getConfigurationClassLoader());
        try {
            try {
                configurations.add(context.getConfigurationData());
            } catch (DeploymentException e) {
                Configuration configuration = context.getConfiguration();
                if (configuration != null) {
                    ConfigurationData dumbConfigurationData = new ConfigurationData(null, null, null, null,
                            configuration.getEnvironment(), context.getBaseDir(), null, context.getNaming());
                    configurations.add(dumbConfigurationData);
                }
                configurations.addAll(context.getAdditionalDeployment());
                throw e;
            }
View Full Code Here

            Artifact configurationId = configurationData.getId();

            // load the configuration
            configurationManager.loadConfiguration(configurationData);
            Configuration configuration = configurationManager.getConfiguration(configurationId);
            configurationManager.startConfiguration(configurationId);
            Set<AbstractName> gb = configuration.getGBeans().keySet();
            for (AbstractName name : gb) {
                if (State.RUNNING_INDEX != kernel.getGBeanState(name)) {
                    log.debug("Not running: " + name);
                }
            }
View Full Code Here

                } else if (info.getType().getValue() == ConfigurationModuleType.EAR.getValue()) {
                    try {
                        AbstractName configObjName = Configuration.getConfigurationAbstractName(info.getConfigID());
                        boolean loaded = loadModule(configManager, configObjName);

                        Configuration config = configManager.getConfiguration(info.getConfigID());
                        if(config != null){
                            for (Configuration child : config.getChildren()) {
                                if (child.getModuleType().getValue() == ConfigurationModuleType.WAR.getValue()) {
                                    ModuleDetails childDetails = new ModuleDetails(info.getConfigID(), child.getModuleType(), info.getState());
                                    childDetails.setComponentName(child.getId().toString());
                                    WebModule webModule = getWebModule(config, child);
                                    if (webModule != null) {
                                        childDetails.getContextPaths().add(webModule.getContextPath());
                                    }
                                    if (showDependencies) {
                                        addDependencies(childDetails, configObjName);
                                    }
                                    moduleDetails.add(childDetails);
                                }
                            }
                        }

                        if (loaded) {
                            unloadModule(configManager, configObjName);
                        }
                    } catch (InvalidConfigException ice) {
                        // Should not occur
                        ice.printStackTrace();
                    }
                }

            } else if (shouldListConfig(info.getType())) {
                ModuleDetails details = new ModuleDetails(info.getConfigID(), info.getType(), getConfigurationState(info));
                try {
                    AbstractName configObjName = Configuration.getConfigurationAbstractName(info.getConfigID());
                    boolean loaded = loadModule(configManager, configObjName);

                    if (info.getType().getValue() == ConfigurationModuleType.EAR.getValue()) {
                        Configuration config = configManager.getConfiguration(info.getConfigID());
                        if(config != null){
                            Iterator childs = config.getChildren().iterator();
                            while (childs.hasNext()) {
                                Configuration child = (Configuration) childs.next();
                                if (child.getModuleType().getValue() == ConfigurationModuleType.WAR.getValue()) {
                                    WebModule webModule = getWebModule(config, child);
                                    if (webModule != null) {
                                        details.getContextPaths().add(webModule.getContextPath());
                                    }
                                }
                            }                                           
                        }
                    } else if (info.getType().equals(ConfigurationModuleType.CAR)) {
                        Configuration config = configManager.getConfiguration(info.getConfigID());
                        details.setClientAppServerSide(config.getOwnedConfigurations().size() > 0);
                    }
                    if (showDependencies) {
                        addDependencies(details, configObjName);
                    }
                    if (loaded) {
View Full Code Here

    private State getConfigurationState(ConfigurationInfo configurationInfo) {
        State configurationState = configurationInfo.getState();
        if (configurationState.isRunning()) {
            // Check whether the Configuration's sub-gbeans are running
            try {
                Configuration configuration = PortletManager.getConfigurationManager().getConfiguration(configurationInfo.getConfigID());
                Map<AbstractName, GBeanData> abstractNameGBeanDataMap = configuration.getGBeans();
                // Check one sub-GBean's state, if one gbean fails to start, all will be shutdown
                Iterator<AbstractName> it = abstractNameGBeanDataMap.keySet().iterator();
                if (it.hasNext()) {
                    AbstractName abstractName = it.next();
                    if (!PortletManager.getKernel().isRunning(abstractName)) {
View Full Code Here

TOP

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

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.