Package org.apache.geronimo.kernel

Examples of org.apache.geronimo.kernel.DependencyManager


        }
        return false;
    }

    private void addDependencies(ModuleDetails details, AbstractName configObjName) {
        DependencyManager depMgr = kernel.getDependencyManager();
        Set<AbstractName> parents = depMgr.getParents(configObjName);
        for (AbstractName parent : parents) {
            details.getParents().add(parent.getArtifact());
        }
        Set<AbstractName> children = depMgr.getChildren(configObjName);
        for (AbstractName child : children) {
            //if(configManager.isConfiguration(child.getArtifact()))
            if (child.getNameProperty("configurationName") != null) {
                details.getChildren().add(child.getArtifact());
            }
View Full Code Here


            for (int i = 0; i < parentId.length; i++) {
                URI uri = parentId[i];
                ObjectName parentName = getConfigurationObjectName(uri);
                parentNames.add(parentName);
            }
            DependencyManager dependencyManager = kernel.getDependencyManager();
            dependencyManager.addDependencies(name, parentNames);
        }
    }
View Full Code Here

            List stores = configurationManager.listStores();
            assert stores.size() == 1 :"Piling one hack on another, this code only works with exactly one store";
            ObjectName storeName = (ObjectName) stores.iterator().next();

            // Unsubscribe topicbrowser before uninstalling the configuration.
            DependencyManager dm = kernel.getDependencyManager();
            //GBeanData topicBrowser = (GBeanData) kernel.invoke(storeName,
            // "getConfiguration", new Object[]{destinationConfigURI}, new
            // String[]{URI.class.getName()});
            GBeanData topicBrowser = kernel.getGBeanData(JMXUtil
                    .getObjectName(ObjectNameConstants.CONFIG_GBEAN_PREFIX
                            + "\"" + destinationConfigURI + "\""));
            java.util.Set children = dm.getChildren(topicBrowser.getName());
            for (Iterator i = children.iterator(); i.hasNext();) {
                ObjectName o = (ObjectName) i.next();
                if ("TopicBrowser".equals(o.getKeyProperty("j2eeType"))) {
                    kernel.invoke(o, "unsubscribe");
                    break;
View Full Code Here

     *
     * @param objectName the bean to find the Configuration for
     * @return the Configuration the bean is in, or null if it is not in a Configuration
     */
    public synchronized static ObjectName getConfiguration(Kernel kernel, ObjectName objectName) {
        DependencyManager mgr = kernel.getDependencyManager();
        Set parents = mgr.getParents(objectName);
        if(parents == null || parents.isEmpty()) {
            log.warn("No parents found for "+objectName);
            return null;
        }
        for (Iterator it = parents.iterator(); it.hasNext();) {
View Full Code Here

        }
        return null;
    }

    private void addDependencies(ModuleDetails details, AbstractName configObjName) {
        DependencyManager depMgr = kernel.getDependencyManager();
        Set<AbstractName> parents = depMgr.getParents(configObjName);
        for (AbstractName parent : parents) {
            details.getParents().add(parent.getArtifact());
        }
        Set<AbstractName> children = depMgr.getChildren(configObjName);
        for (AbstractName child : children) {
            //if(configManager.isConfiguration(child.getArtifact()))
            if (child.getNameProperty("configurationName") != null) {
                details.getChildren().add(child.getArtifact());
            }
View Full Code Here

        messageStatus += "<br/>";
        for (int i=0;i<tab;i++)
            messageStatus += "&nbsp;&nbsp;";
        messageStatus +=config.toString();

        DependencyManager depMgr = kernel.getDependencyManager();

        java.util.Set children = depMgr.getChildren(config);
        for (Iterator itr = children.iterator(); itr.hasNext(); ) {
            AbstractName child = (AbstractName)itr.next();
            //if(configManager.isConfiguration(child.getArtifact()))
            if (child.getNameProperty("configurationName") != null) {
                printChilds(child,tab+1);
View Full Code Here

            return;
        }

        List moduleDetails = new ArrayList();
        ConfigurationManager configManager = ConfigurationUtil.getConfigurationManager(kernel);
        DependencyManager depMgr = kernel.getDependencyManager();
        List infos = configManager.listConfigurations();
        for (Iterator j = infos.iterator(); j.hasNext();) {
            ConfigurationInfo info = (ConfigurationInfo) j.next();
            if (shouldListConfig(info)) {
                ModuleDetails details = new ModuleDetails(info.getConfigID(), info.getType(), info.getState());

                if (info.getType().getValue()== ConfigurationModuleType.WAR.getValue()){
                    WebModule webModule = (WebModule) PortletManager.getModule(renderRequest, info.getConfigID());
                    if (webModule != null) {
                        details.setContextPath(webModule.getContextPath());
                    }
                }
                try {
                    AbstractName configObjName = Configuration.getConfigurationAbstractName(info.getConfigID());
                    boolean flag = false;
                    // Check if the configuration is loaded.  If not, load it to get information.
                    if(!kernel.isLoaded(configObjName)) {
                        try {
                            configManager.loadConfiguration(configObjName.getArtifact());
                            flag = true;
                        } catch (NoSuchConfigException e) {
                            // Should not occur
                            e.printStackTrace();
                        } catch (LifecycleException e) {
          // config could not load because one or more of its dependencies
          // has been removed. cannot load the configuration in this case,
          // so don't rely on that technique to discover its parents or children
          if (e.getCause() instanceof MissingDependencyException) {
        // do nothing
          } else {
        e.printStackTrace();
          }
      }
                    }

                    java.util.Set parents = depMgr.getParents(configObjName);
                    for(Iterator itr = parents.iterator(); itr.hasNext(); ) {
                        AbstractName parent = (AbstractName)itr.next();
                        details.getParents().add(parent.getArtifact());
                    }
                    java.util.Set children = depMgr.getChildren(configObjName);
                    for(Iterator itr = children.iterator(); itr.hasNext(); ) {
                        AbstractName child = (AbstractName)itr.next();
                        //if(configManager.isConfiguration(child.getArtifact()))
                        if(child.getNameProperty("configurationName") != null) {
                            details.getChildren().add(child.getArtifact());
View Full Code Here

            List stores = configurationManager.listStores();
            assert stores.size() == 1 :"Piling one hack on another, this code only works with exactly one store";
            ObjectName storeName = (ObjectName) stores.iterator().next();

            // Unsubscribe topicbrowser before uninstalling the configuration.
            DependencyManager dm = kernel.getDependencyManager();
            //GBeanData topicBrowser = (GBeanData) kernel.invoke(storeName,
            // "getConfiguration", new Object[]{destinationConfigURI}, new
            // String[]{URI.class.getName()});
            GBeanData topicBrowser = kernel.getGBeanData(configurationObjectName);
            java.util.Set children = dm.getChildren(topicBrowser.getAbstractName());
            for (Iterator i = children.iterator(); i.hasNext();) {
                ObjectName o = (ObjectName) i.next();
                if ("TopicBrowser".equals(o.getKeyProperty("j2eeType"))) {
                    kernel.invoke(o, "unsubscribe");
                    break;
View Full Code Here

        messageStatus += "<br/>";
        for (int i=0;i<tab;i++)
            messageStatus += "&nbsp;&nbsp;";
        messageStatus +=config.toString();

        DependencyManager depMgr = kernel.getDependencyManager();

        java.util.Set children = depMgr.getChildren(config);
        for (Iterator itr = children.iterator(); itr.hasNext(); ) {
            AbstractName child = (AbstractName)itr.next();
            //if(configManager.isConfiguration(child.getArtifact()))
            if (child.getNameProperty("configurationName") != null) {
                printChilds(child,tab+1);
View Full Code Here

            return;
        }

        List moduleDetails = new ArrayList();
        ConfigurationManager configManager = ConfigurationUtil.getConfigurationManager(kernel);
        DependencyManager depMgr = kernel.getDependencyManager();
        List infos = configManager.listConfigurations();
        for (Iterator j = infos.iterator(); j.hasNext();) {
            ConfigurationInfo info = (ConfigurationInfo) j.next();
            if (shouldListConfig(info)) {
                ModuleDetails details = new ModuleDetails(info.getConfigID(), info.getType(), info.getState());

                if (info.getType().getValue()== ConfigurationModuleType.WAR.getValue()){
                    WebModule webModule = (WebModule) PortletManager.getModule(renderRequest, info.getConfigID());
                    if (webModule != null) {
                        details.setContextPath(webModule.getContextPath());
                    }
                }
                try {
                    AbstractName configObjName = Configuration.getConfigurationAbstractName(info.getConfigID());
                    boolean flag = false;
                    // Check if the configuration is loaded.  If not, load it to get information.
                    if(!kernel.isLoaded(configObjName)) {
                        try {
                            configManager.loadConfiguration(configObjName.getArtifact());
                            flag = true;
                        } catch (NoSuchConfigException e) {
                            // Should not occur
                            e.printStackTrace();
                        } catch (LifecycleException e) {
          // config could not load because one or more of its dependencies
          // has been removed. cannot load the configuration in this case,
          // so don't rely on that technique to discover its parents or children
          if (e.getCause() instanceof MissingDependencyException) {
        // do nothing
          } else {
        e.printStackTrace();
          }
      }
                    }

                    java.util.Set parents = depMgr.getParents(configObjName);
                    for(Iterator itr = parents.iterator(); itr.hasNext(); ) {
                        AbstractName parent = (AbstractName)itr.next();
                        details.getParents().add(parent.getArtifact());
                    }
                    java.util.Set children = depMgr.getChildren(configObjName);
                    for(Iterator itr = children.iterator(); itr.hasNext(); ) {
                        AbstractName child = (AbstractName)itr.next();
                        //if(configManager.isConfiguration(child.getArtifact()))
                        if(child.getNameProperty("configurationName") != null) {
                            details.getChildren().add(child.getArtifact());
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.DependencyManager

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.