Package org.apache.geronimo.kernel.config

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


        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 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);
        IOUtil.recursiveDelete(location);
        //todo: for Maven 2 repo, delete the version directory if there's nothing left in it (probably the case)

        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

                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

        for (Iterator i = stores.iterator(); i.hasNext();) {
            AbstractName storeName = (AbstractName) i.next();
            try {
                List infos = mgr.listConfigurations(storeName);
                for (Iterator j = infos.iterator(); j.hasNext();) {
                    ConfigurationInfo info = (ConfigurationInfo) j.next();
                    AbstractName configuration = Configuration.getConfigurationAbstractName(info.getConfigID());
                    if (type == null || type.getValue() == info.getType().getValue()) {
                        J2EEDeployedObject module = getModuleForConfiguration(info.getConfigID());
                        results.add(new ConfigurationData(info.getConfigID(), configuration, null, info.getState(), info.getType(), module == null ? null : kernel.getAbstractNameFor(module)));
                    }
                    if (includeChildModules && info.getType().getValue() == ConfigurationModuleType.EAR.getValue() && info.getState().toInt() == State.RUNNING_INDEX)
                    {
                        J2EEApplication app = (J2EEApplication) getModuleForConfiguration(info.getConfigID());
                        if (app == null) {
                            throw new IllegalStateException("Unable to load children for J2EE Application '" + info.getConfigID() + "' (no J2EEApplication found)");
                        }
                        Object[] modules = null;
                        if (type == null) {
                            modules = app.getModulesInstances();
                        } else if (type.equals(ConfigurationModuleType.CAR)) {
                            modules = app.getClientModules();
                        } else if (type.equals(ConfigurationModuleType.EJB)) {
                            modules = app.getEJBModules();
                        } else if (type.equals(ConfigurationModuleType.RAR)) {
                            modules = app.getRAModules();
                        } else if (type.equals(ConfigurationModuleType.WAR)) {
                            modules = app.getWebModules();
                        } //todo: handle dynamically registered module types, etc.
                        if (modules == null) continue;
                        for (int k = 0; k < modules.length; k++) {
                            Object module = modules[k];
                            ConfigurationModuleType moduleType = type;
                            if (moduleType == null) {
                                if (module instanceof WebModule) {
                                    moduleType = ConfigurationModuleType.WAR;
                                } else if (module instanceof EJBModule) {
                                    moduleType = ConfigurationModuleType.EJB;
                                } else if (module instanceof ResourceAdapterModule) {
                                    moduleType = ConfigurationModuleType.RAR;
                                } else if (module instanceof AppClientModule) moduleType = ConfigurationModuleType.CAR;
                            }
                            String moduleName;
                            if (type != null && type.equals(ConfigurationModuleType.WAR)) {
                                moduleName = ((WebModule) module).getWARName();
                            } else {
                                //todo: solutions for other module types
                                moduleName = (String) kernel.getAbstractNameFor(module).getName().get(NameFactory.J2EE_NAME);
                            }
                            results.add(new ConfigurationData(info.getConfigID(), configuration, moduleName, info.getState(), moduleType, kernel.getAbstractNameFor(module)));
                        }
                    }
                }
            } catch (NoSuchStoreException e) {
                // we just got this list so this should not happen
View Full Code Here

        if (dir.list().length == 0) {
            return null;
        }

        // get the existing inplace configuration if there is one
        ConfigurationInfo existingConfiguration = null;
        List list = configurationManager.listConfigurations();
        for (Iterator iterator = list.iterator(); iterator.hasNext();) {
            ConfigurationInfo configurationInfo = (ConfigurationInfo) iterator.next();
            if (dir.equals(configurationInfo.getInPlaceLocation())) {
                existingConfiguration = configurationInfo;
            }
        }
        Artifact existingConfigurationId = (existingConfiguration == null) ? null : existingConfiguration.getConfigID();
View Full Code Here

        for (Iterator i = stores.iterator(); i.hasNext();) {
            AbstractName storeName = (AbstractName) i.next();
            try {
                List infos = mgr.listConfigurations(storeName);
                for (Iterator j = infos.iterator(); j.hasNext();) {
                    ConfigurationInfo info = (ConfigurationInfo) j.next();
                    AbstractName configuration = Configuration.getConfigurationAbstractName(info.getConfigID());
                    if (type == null || type.getValue() == info.getType().getValue()) {
                        J2EEDeployedObject module = getModuleForConfiguration(info.getConfigID());
                        results.add(new ConfigurationData(info.getConfigID(), configuration, null, info.getState(), info.getType(), module == null ? null : kernel.getAbstractNameFor(module)));
                    }
                    if (includeChildModules && info.getType().getValue() == ConfigurationModuleType.EAR.getValue() && info.getState().toInt() == State.RUNNING_INDEX)
                    {
                        J2EEApplication app = (J2EEApplication) getModuleForConfiguration(info.getConfigID());
                        if (app == null) {
                            throw new IllegalStateException("Unable to load children for J2EE Application '" + info.getConfigID() + "' (no J2EEApplication found)");
                        }
                        Object[] modules = null;
                        if (type == null) {
                            modules = app.getModulesInstances();
                        } else if (type.equals(ConfigurationModuleType.CAR)) {
                            modules = app.getClientModules();
                        } else if (type.equals(ConfigurationModuleType.EJB)) {
                            modules = app.getEJBModules();
                        } else if (type.equals(ConfigurationModuleType.RAR)) {
                            modules = app.getRAModules();
                        } else if (type.equals(ConfigurationModuleType.WAR)) {
                            modules = app.getWebModules();
                        } //todo: handle dynamically registered module types, etc.
                        if (modules == null) continue;
                        for (int k = 0; k < modules.length; k++) {
                            Object module = modules[k];
                            ConfigurationModuleType moduleType = type;
                            if (moduleType == null) {
                                if (module instanceof WebModule) {
                                    moduleType = ConfigurationModuleType.WAR;
                                } else if (module instanceof EJBModule) {
                                    moduleType = ConfigurationModuleType.EJB;
                                } else if (module instanceof ResourceAdapterModule) {
                                    moduleType = ConfigurationModuleType.RAR;
                                } else if (module instanceof AppClientModule) moduleType = ConfigurationModuleType.CAR;
                            }
                            String moduleName;
                            if (type != null && type.equals(ConfigurationModuleType.WAR)) {
                                moduleName = ((WebModule) module).getWARName();
                            } else {
                                //todo: solutions for other module types
                                moduleName = (String) kernel.getAbstractNameFor(module).getName().get(NameFactory.J2EE_NAME);
                            }
                            results.add(new ConfigurationData(info.getConfigID(), configuration, moduleName, info.getState(), moduleType, kernel.getAbstractNameFor(module)));
                        }
                    }
                }
            } catch (NoSuchStoreException e) {
                // we just got this list so this should not happen
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.