Package org.apache.geronimo.kernel.config

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


    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

    private Artifact searchOneParent(Configuration configuration, Artifact working) {
        LinkedHashSet<Artifact> parentIds = configuration.getDependencyNode().getClassParents();
        if (!parentIds.isEmpty()) {
            for (Artifact parentId: parentIds) {
                Configuration parent = getConfiguration(parentId);
                Artifact artifact = searchParent(parent, working);
                if (artifact != null) {
                    return artifact;
                }
            }
View Full Code Here

            return;
        }
        if (!configurationManager.isConfiguration(artifact)) {
            return;
        }
        Configuration configuration = configurationManager.getConfiguration(artifact);
        List<Bundle> dependentSharedLibBundles = new ArrayList<Bundle>();
        for (Artifact parentArtifact : configuration.getDependencyNode().getParents()) {
            List<Bundle> sharedLibBundles = configruationSharedLibBundlesMap.get(parentArtifact);
            if (sharedLibBundles != null) {
                dependentSharedLibBundles.addAll(sharedLibBundles);
            }
        }
View Full Code Here

            configMgr = PortletManager.getConfigurationManager();
        }
        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

        return destination;
    }


    private Reference buildAdminObjectReference(Module module, AbstractNameQuery containerId) throws DeploymentException {
        Configuration localConfiguration = module.getEarContext().getConfiguration();
        try {
            AbstractName abstractName = localConfiguration.findGBean(containerId);
            //String osgiJndiName = "aries:services/" + module.getEarContext().getNaming().toOsgiJndiName(abstractName);
            return new JndiReference("aries:services/", abstractName);
        } catch (GBeanNotFoundException e) {
            throw new DeploymentException("Can not resolve admin object ref " + containerId + " in configuration " + localConfiguration.getId(), e);
        }
    }
View Full Code Here

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

                GBeanData jndiContextGBeanData = new GBeanData(jndiContextName, StaticJndiContextPlugin.class);
                jndiContextGBeanData.setAttribute("uri", uri);
                try {
                    Map<EARContext.Key, Object> buildingContext = new HashMap<EARContext.Key, Object>();
                    buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, jndiContextName);
                    Configuration localConfiguration = appClientDeploymentContext.getConfiguration();
                    Configuration remoteConfiguration = earContext.getConfiguration();

                    if (!appClient.isMetadataComplete()) {
                        // 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

       
        Artifact id = Artifact.create(CONFIG_ID);
        id = artifactResolver.queryArtifact(id);
        manager.loadConfiguration(id);
       
        Configuration config = manager.getConfiguration(id);
               
        // set context classloader
        ClassLoader classLoader = config.getConfigurationClassLoader();
        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();       
        Thread.currentThread().setContextClassLoader(classLoader);
                          
        // set "java.class.path" system property
        String classPath = getClasspath(classLoader);
View Full Code Here

        thread.setContextClassLoader(new BundleClassLoader(context.getConfiguration().getBundle()));
        try {
            try {
                configurationDatas.add(context.getConfigurationData());
            } catch (DeploymentException e) {
                Configuration configuration = context.getConfiguration();
                if (configuration != null) {
                    ConfigurationData dumbConfigurationData = new ConfigurationData(null, null, null,
                            configuration.getEnvironment(), context.getBaseDir(), null, context.getNaming());
                    configurationDatas.add(dumbConfigurationData);
                }
                configurationDatas.addAll(context.getAdditionalDeployment());
                throw e;
            }
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.