Package org.apache.geronimo.kernel.config

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


                File ser = new File(meta, "config.ser");
                if (!ser.isFile() || !ser.canRead() || ser.length() == 0) {
                    continue;
                }
                try {
                    ConfigurationInfo configurationInfo = loadConfigurationInfo(configId);
                    configs.add(configurationInfo);
                } catch (NoSuchConfigException e) {
                    log.error("Unexpected error: found META-INF/config.ser for " + configId + " but couldn't load ConfigurationInfo", e);
                } catch (IOException e) {
                    log.error("Unable to load ConfigurationInfo for " + configId, e);
View Full Code Here


            throw new NoSuchConfigException(configId);
        }

        File inPlaceLocation = inPlaceConfUtil.readInPlaceLocation(location);

        ConfigurationInfo configurationInfo;
        if (location.isDirectory()) {
            File infoFile = new File(location, "META-INF");
            infoFile = new File(infoFile, "config.info");

            InputStream in = new FileInputStream(infoFile);
View Full Code Here

        isConfigurationInstalled = false;

        touch(watchFile1, NOW);
        touch(watchFile2, NOW);

        existingConfigurationInfos.add(new ConfigurationInfo(null, NEW_ID, ConfigurationModuleType.CAR, PAST, null, null, dir));

        SingleFileHotDeployer singleFileHotDeployer = new SingleFileHotDeployer(dir,
                watchPaths,
                Collections.singleton(builder),
                store,
View Full Code Here

        isConfigurationInstalled = false;

        touch(watchFile1, NOW);
        touch(watchFile2, NOW);

        existingConfigurationInfos.add(new ConfigurationInfo(null, DIFFERENT_ID, ConfigurationModuleType.CAR, PAST, null, null, dir));

        SingleFileHotDeployer singleFileHotDeployer = new SingleFileHotDeployer(dir,
                watchPaths,
                Collections.singleton(builder),
                store,
View Full Code Here

        isConfigurationInstalled = false;

        touch(watchFile1, NOW);
        touch(watchFile2, NOW);

        existingConfigurationInfos.add(new ConfigurationInfo(null, OLD_VERSION_ID, ConfigurationModuleType.CAR, PAST, null, null, dir));

        SingleFileHotDeployer singleFileHotDeployer = new SingleFileHotDeployer(dir,
                watchPaths,
                Collections.singleton(builder),
                store,
View Full Code Here

        isConfigurationInstalled = false;

        touch(watchFile1, PAST);
        touch(watchFile2, PAST);

        existingConfigurationInfos.add(new ConfigurationInfo(null, NEW_ID, ConfigurationModuleType.CAR, NOW, null, null, dir));

        SingleFileHotDeployer singleFileHotDeployer = new SingleFileHotDeployer(dir,
                watchPaths,
                Collections.singleton(builder),
                store,
View Full Code Here

        isConfigurationInstalled = false;

        touch(watchFile1, PAST);
        touch(watchFile2, PAST);

        existingConfigurationInfos.add(new ConfigurationInfo(null, OLD_VERSION_ID, ConfigurationModuleType.CAR, NOW, null, null, dir));

        SingleFileHotDeployer singleFileHotDeployer = new SingleFileHotDeployer(dir,
                watchPaths,
                Collections.singleton(builder),
                store,
View Full Code Here

    }
   
    public void testListConfigurationFilterNoneMasterConfigIds() throws Exception {
        List<ConfigurationInfo> configurationInfos = new ArrayList<ConfigurationInfo>();

        ConfigurationInfo configurationInfo =  newConfigurationInfo(configId);
        configurationInfos.add(configurationInfo);
       
        Artifact configId2 = new Artifact("groupId", "artifactId2", "2.0", "car");
        ConfigurationInfo configurationInfo2 =  newConfigurationInfo(configId2);
        configurationInfos.add(configurationInfo2);
       
        delegate.listConfigurations();
        modify().returnValue(configurationInfos);
       
View Full Code Here

            }
        });
    }
   
    private ConfigurationInfo newConfigurationInfo(Artifact configId) {
        return new ConfigurationInfo(
            clusterInfoName,
            configId,
            ConfigurationModuleType.CAR,
            1l,
            Collections.EMPTY_SET,
View Full Code Here

    public void uninstall(Artifact configId) throws NoSuchConfigException, IOException {
        if(!configId.isResolved()) {
            throw new IllegalArgumentException("Artifact "+configId+" is not fully resolved");
        }
        ConfigurationInfo configurationInfo = null;
        try {
            configurationInfo = loadConfigurationInfo(configId);
        } catch (IOException e) {
            // don't really care
        }
        File location = repository.getLocation(configId);
        FileUtils.recursiveDelete(location);
        // Number of directory levels up, to check and delete empty parent directories in the repo
        int dirDepth = 0;

        // FIXME: Determine the repository type
        // For now assume the repo is a Maven2Repository.  This should not cause any harm even if it is an
        // Maven1Repository, for it would be deleting the 'repository' directory if it happens to be empty.
        boolean m2repo = true;
        if(m2repo) {
            // Check version, artifact and group directories, i.e. 3 levels up
            dirDepth = 3;
        }

        File temp = location;
        for(int i = 0; i < dirDepth; ++i) {
            if((temp = temp.getParentFile()).listFiles().length == 0) {
                // Directory is empty.  Remove it.
                temp.delete();
            } else {
                // Directory is not empty.  No need to check any more parent directories
                break;
            }
        }

        if (configurationInfo != null) {
            IOException ioException = null;
            for (Iterator iterator = configurationInfo.getOwnedConfigurations().iterator(); iterator.hasNext();) {
                Artifact ownedConfiguration = (Artifact) iterator.next();
                try {
                    uninstall(ownedConfiguration);
                } catch (NoSuchConfigException e) {
                    // ignored - already deleted or never installed
View Full Code Here

TOP

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

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.