Examples of ConfigurationData


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

            try {
                if (targetFile != null) {
                    if (configurations.size() > 1) {
                        throw new DeploymentException("Deployer created more than one configuration");
                    }
                    ConfigurationData configurationData = (ConfigurationData) configurations.get(0);
                    ExecutableConfigurationUtil.createExecutableConfiguration(configurationData, manifest, targetFile);
                }
                if (install) {
                    List deployedURIs = new ArrayList();
                    for (Iterator iterator = configurations.iterator(); iterator.hasNext();) {
                        ConfigurationData configurationData = (ConfigurationData) iterator.next();
                        store.install(configurationData);
                        deployedURIs.add(configurationData.getId().toString());
                    }
                    notifyWatchers(deployedURIs);
                    return deployedURIs;
                } else {
                    cleanupConfigurations(configurations);
View Full Code Here

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

        }
    }

    private void cleanupConfigurations(List configurations) {
        for (Iterator iterator = configurations.iterator(); iterator.hasNext();) {
            ConfigurationData configurationData = (ConfigurationData) iterator.next();
            File configurationDir = configurationData.getConfigurationDir();
            if (!DeploymentUtil.recursiveDelete(configurationDir)) {
                pendingDeletionIndex.setProperty(configurationDir.getName(), "delete");
                log.debug("Queued deployment directory to be reaped " + configurationDir);
            }
        }
View Full Code Here

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

                if (configurations.isEmpty()) {
                    throw new DeploymentException("Deployer did not create any configurations");
                }
                List deployedURIs = new ArrayList();
                for (Iterator iterator = configurations.iterator(); iterator.hasNext();) {
                    ConfigurationData configurationData = (ConfigurationData) iterator.next();
                    configurationData.setAutoStart(false);
                    store.install(configurationData);
                    deployedURIs.add(configurationData.getId().toString());
                }
                return deployedURIs;
            } catch (IOException e) {
                cleanupConfigurations(configurations);
                throw e;
View Full Code Here

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

    }

    private void cleanupConfigurations(List configurations) {
        LinkedList cannotBeDeletedList = new LinkedList();
        for (Iterator iterator = configurations.iterator(); iterator.hasNext();) {
            ConfigurationData configurationData = (ConfigurationData) iterator.next();
            File dir = configurationData.getConfigurationDir();
            cannotBeDeletedList.clear();
            if (!DeploymentUtil.recursiveDelete(dir,cannotBeDeletedList)) {
                // Output a message to help user track down file problem
                log.warn("Unable to delete " + cannotBeDeletedList.size() +
                        " files while recursively deleting directory "
View Full Code Here

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

        if (configurationDir != null) {
            cleanupConfigurationDir(configurationDir);
        }
        // cleanup any other configurations generated (e.g. AppClient config dirs)
        for (Iterator iterator = configurations.iterator(); iterator.hasNext();) {
            ConfigurationData configurationData = (ConfigurationData) iterator.next();
            cleanupConfigurationDir(configurationData.getConfigurationDir());
        }
    }
View Full Code Here

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

     * the local maven installation.
     */
    private void bootDeployerSystem() throws Exception {
        Artifact baseId = new Artifact("geronimo", "packaging", "fixed", "car");
        Naming naming = kernel.getNaming();
        ConfigurationData bootstrap = new ConfigurationData(baseId, naming);
        ClassLoader cl = PackageBuilder.class.getClassLoader();
        Set repoNames = new HashSet();

        //Source repo
        GBeanData repoGBean = bootstrap.addGBean("SourceRepository", GBeanInfo.getGBeanInfo(repositoryClass, cl));
        URI repositoryURI = repository.toURI();
        repoGBean.setAttribute("root", repositoryURI);
        repoNames.add(repoGBean.getAbstractName());

        //Target repo
        GBeanData targetRepoGBean = bootstrap.addGBean("TargetRepository", GBeanInfo.getGBeanInfo(targetRepositoryClass, cl));
        URI targetRepositoryURI = targetRepository.toURI();
        targetRepoGBean.setAttribute("root", targetRepositoryURI);
        repoNames.add(targetRepoGBean.getAbstractName());
        targetRepositoryAName = targetRepoGBean.getAbstractName();

        GBeanData artifactManagerGBean = bootstrap.addGBean("ArtifactManager", DefaultArtifactManager.GBEAN_INFO);

        GBeanData artifactResolverGBean = bootstrap.addGBean("ArtifactResolver", ExplicitDefaultArtifactResolver.GBEAN_INFO);
        artifactResolverGBean.setAttribute("versionMapLocation", explicitResolutionLocation);
        ReferencePatterns repoPatterns = new ReferencePatterns(repoNames);
        artifactResolverGBean.setReferencePatterns("Repositories", repoPatterns);
        artifactResolverGBean.setReferencePattern("ArtifactManager", artifactManagerGBean.getAbstractName());

        Set storeNames = new HashSet();
        //source config store
        GBeanInfo configStoreInfo = GBeanInfo.getGBeanInfo(configurationStoreClass, cl);
        GBeanData storeGBean = bootstrap.addGBean("ConfigStore", configStoreInfo);
        if (configStoreInfo.getReference("Repository") != null) {
            storeGBean.setReferencePattern("Repository", repoGBean.getAbstractName());
        }
        storeNames.add(storeGBean.getAbstractName());

        //target config store
        GBeanInfo targetConfigStoreInfo = GBeanInfo.getGBeanInfo(targetConfigurationStoreClass, cl);
        GBeanData targetStoreGBean = bootstrap.addGBean("TargetConfigStore", targetConfigStoreInfo);
        if (targetConfigStoreInfo.getReference("Repository") != null) {
            targetStoreGBean.setReferencePattern("Repository", targetRepoGBean.getAbstractName());
        }
        storeNames.add(targetStoreGBean.getAbstractName());

        targetConfigStoreAName = targetStoreGBean.getAbstractName();
        targetSet = true;

        GBeanData attrManagerGBean = bootstrap.addGBean("AttributeStore", MavenAttributeStore.GBEAN_INFO);

        GBeanData configManagerGBean = bootstrap.addGBean("ConfigManager", KernelConfigurationManager.GBEAN_INFO);
        configManagerGBean.setReferencePatterns("Stores", new ReferencePatterns(storeNames));
        configManagerGBean.setReferencePattern("AttributeStore", attrManagerGBean.getAbstractName());
        configManagerGBean.setReferencePattern("ArtifactManager", artifactManagerGBean.getAbstractName());
        configManagerGBean.setReferencePattern("ArtifactResolver", artifactResolverGBean.getAbstractName());
        configManagerGBean.setReferencePatterns("Repositories", repoPatterns);
View Full Code Here

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

            List configs = sourceConfigStore.listConfigurations();
            for (Iterator iterator = configs.iterator(); iterator.hasNext();) {
                ConfigurationInfo configInfo = (ConfigurationInfo) iterator.next();
                Artifact configId = configInfo.getConfigID();
                ConfigurationData configData = sourceConfigStore.loadConfiguration(configId);
                if (targetConfigStore.containsConfiguration(configId)) {
                    targetConfigStore.uninstall(configId);
                }
                targetConfigStore.install(configData);
            }
View Full Code Here

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

            return new SerializedConfigurationMarshaler().readConfigurationData(pushbackInputStream);
        }

        XStream xstream = XStreamUtil.createXStream();
        Reader reader = new InputStreamReader(pushbackInputStream);
        ConfigurationData configurationData = (ConfigurationData)xstream.fromXML(reader);
        return configurationData;
    }
View Full Code Here

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

    public boolean canConvert(Class clazz) {
        return ConfigurationData.class.isAssignableFrom(clazz);
    }

    public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext marshallingContext) {
        ConfigurationData configurationData = (ConfigurationData) object;
        writer.addAttribute("configuration-data-version", "1.1");
        super.marshal(configurationData, writer, marshallingContext);
    }
View Full Code Here

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

        suite.addTest(setupPackedAltDD);
        return suite;
    }

    public void testBuildConfiguration() throws Exception {
        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId,
                    transactionContextManagerAbstractNameQuery,
                    connectionTrackerAbstractNameQuery,
                    transactionalTimerAbstractNameQuery,
                    nonTransactionalTimerAbstractNameQuery,
                    corbaGBeanAbstractNameQuery,
                    null,
                    null,
                    ejbConfigBuilder,
                    ejbConfigBuilder,
                    webConfigBuilder,
                    connectorConfigBuilder,
                    resourceReferenceBuilder,
                    appClientConfigBuilder,
                    serviceReferenceBuilder,
                    naming);

            Object plan = configBuilder.getDeploymentPlan(null, earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = context.getConfigurationData();
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.