Package org.apache.geronimo.kernel.config

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


    /**
     * Cache the ClassLoader for a newly started Configuration. 
     */
    private void configurationRunning(AbstractName name) {
        try {
            Configuration config = (Configuration)kernel.getGBean(name);
            classLoaderMap.put(name, config.getConfigurationClassLoader());
        } catch (GBeanNotFoundException gnfe) {
            log.warn("Could not retrieve GBean for artifact: " + name.toString(), gnfe);
        }
    }
View Full Code Here


            throw new UnsupportedOperationException();
        }

        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

                } 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());
                        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());
                                }
                                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(), info.getState());
                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());
                        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());
                                }
                            }
View Full Code Here

        //N.B. we use the ear context which has all the gbeans we could possibly be looking up from this ear.
        Map buildingContext = new HashMap();
        buildingContext.put(NamingBuilder.JNDI_KEY, new HashMap());
        buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, moduleName);
        Configuration earConfiguration = earContext.getConfiguration();
        getNamingBuilders().buildNaming(webApp, jettyWebApp, earConfiguration, earConfiguration, (Module) webModule, buildingContext);
        Map compContext = (Map) buildingContext.get(NamingBuilder.JNDI_KEY);


        GBeanData webModuleData = new GBeanData(moduleName, JettyWebAppContext.GBEAN_INFO);
View Full Code Here

                GBeanData jndiContextGBeanData = new GBeanData(jndiContextName, StaticJndiContextPlugin.GBEAN_INFO);
                try {
                    Map buildingContext = new HashMap();
                    buildingContext.put(NamingBuilder.JNDI_KEY, new HashMap());
                    buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, jndiContextName);
                    Configuration localConfiguration = appClientDeploymentContext.getConfiguration();
                    Configuration remoteConfiguration = earContext.getConfiguration();
                    namingBuilders.buildNaming(appClient, geronimoAppClient, localConfiguration, remoteConfiguration, appClientModule, buildingContext);
                    jndiContextGBeanData.setAttribute("context", buildingContext.get(NamingBuilder.JNDI_KEY));
                } catch (DeploymentException e) {
                    throw e;
                } catch (Exception e) {
View Full Code Here

        }
        for (int i = 0; i < results.length; i++) {
            final GeronimoManagedBean managedBean = (GeronimoManagedBean) realms[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

    public void testConfigLifecycle() throws Exception {
        Artifact configurationId = configurationData.getId();

        // load -- config should be running and gbean registered but not started
        configurationManager.loadConfiguration(configurationData);
        Configuration configuration = configurationManager.getConfiguration(configurationId);
        AbstractName configurationName = Configuration.getConfigurationAbstractName(configurationId);

        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(configurationName));
        assertNotNull(configuration.getConfigurationClassLoader());

        assertFalse(kernel.isLoaded(gbeanName1));
        assertFalse(kernel.isLoaded(gbeanName2));

        // start -- gbeans should now be started
View Full Code Here

    public void testConfigStartStopRestart() throws Exception {
        Artifact configurationId = configurationData.getId();

        // load -- config should be running and gbean registered but not started
        configurationManager.loadConfiguration(configurationData);
        Configuration configuration = configurationManager.getConfiguration(configurationId);
        AbstractName configurationName = Configuration.getConfigurationAbstractName(configurationId);

        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(configurationName));
        assertNotNull(configuration.getConfigurationClassLoader());

        assertFalse(kernel.isLoaded(gbeanName1));
        assertFalse(kernel.isLoaded(gbeanName2));

View Full Code Here

    public void testAddToConfig() throws Exception {
        Artifact configurationId = configurationData.getId();

        // load and start the config
        configurationManager.loadConfiguration(configurationData);
        Configuration configuration = configurationManager.getConfiguration(configurationId);
        assertNotNull(configuration.getConfigurationClassLoader());

        GBeanData mockBean3 = new GBeanData(MockGBean.getGBeanInfo());
        try {
            kernel.getGBeanState(mockBean3.getAbstractName());
            fail("Gbean should not be found yet");
View Full Code Here

        ConfigurationResolver configurationResolver = new ConfigurationResolver(parentConfigurationData,
                Collections.singleton(mockRepository),
                artifactResolver);

        Configuration parent = new Configuration(null,
                parentConfigurationData,
                configurationResolver,
                null);

        LinkedHashSet<Configuration> parents = new LinkedHashSet<Configuration>();
View Full Code Here

TOP

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

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.