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


            RenderResponse response) {
        Kernel kernel = KernelRegistry.getSingleKernel();

        Set destinations = kernel.listGBeans(DESTINATION_QUERY);
        List destinationInfos = new ArrayList(destinations.size());
        DependencyManager dm = kernel.getDependencyManager();
        for (Iterator iterator = destinations.iterator(); iterator.hasNext();) {
            ObjectName destinationName = (ObjectName) iterator.next();

            try {
                Class type;
                try {
                    type = Class.forName((String) kernel.getAttribute(
                            destinationName, "adminObjectInterface"));
                } catch (ClassCastException cce) {
                    type = (Class) kernel.getAttribute(destinationName,
                            "adminObjectInterface");
                }
                Set parents = dm.getParents(destinationName);
                Iterator i = parents.iterator();
                // If no parents this is a configuration we don't need those
                // here.
                if (!i.hasNext()) {
                    continue;
View Full Code Here

                return false;
            }
            waitingForMe = false;

            // stop all gbeans that would match our patterns from starting
            DependencyManager dependencyManager = getDependencyManager();
            dependencyManager.addStartHolds(objectName, getPatterns());

            // add a dependency on our target and create the proxy
            ObjectName target = (ObjectName) targets.iterator().next();
            setProxy(getKernel().getProxyManager().createProxy(target, getReferenceType()));
            proxyTarget = target;
            dependencyManager.addDependency(objectName, target);
        }

        return true;
    }
View Full Code Here

    public synchronized void stop() {
        waitingForMe = false;
        ObjectName objectName = getGBeanInstance().getObjectNameObject();
        Set patterns = getPatterns();
        DependencyManager dependencyManager = getDependencyManager();
        if (!patterns.isEmpty()) {
            dependencyManager.removeStartHolds(objectName, patterns);
        }

        Object proxy = getProxy();
        if (proxy != null) {
            dependencyManager.removeDependency(objectName, proxyTarget);
            getKernel().getProxyManager().destroyProxy(proxy);
            setProxy(null);
            proxyTarget = null;
        }
    }
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());
                        details.setUrlFor(webModule.getURLFor());
                    }
                }
                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)) {
                        flag = true;
                        try {
                            configManager.loadConfiguration(configObjName.getArtifact());
                        } catch (NoSuchConfigException e) {
                            // Should not occur
                            e.printStackTrace();
                        } catch (LifecycleException e) {
                            // TODO Auto-generated catch block
                            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

        }
        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

        }
        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

        }
        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

                throw new PortletException("No configuration store");
            }
            ObjectName storeName = (ObjectName) stores.get(0);

            // 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

            RenderResponse response) {
        Kernel kernel = KernelRegistry.getSingleKernel();

        Set destinations = kernel.listGBeans(new AbstractNameQuery(Destination.class.getName()));
        List destinationInfos = new ArrayList(destinations.size());
        DependencyManager dm = kernel.getDependencyManager();
        for (Iterator iterator = destinations.iterator(); iterator.hasNext();) {
            AbstractName destinationName = (AbstractName) iterator.next();

            try {
                Class type;
                try {
                    type = Class.forName((String) kernel.getAttribute(
                            destinationName, "adminObjectInterface"));
                } catch (ClassCastException cce) {
                    type = (Class) kernel.getAttribute(destinationName,
                            "adminObjectInterface");
                }
                Set parents = dm.getParents(destinationName);
                Iterator i = parents.iterator();
                // If no parents this is a configuration we don't need those
                // here.
                if (!i.hasNext()) {
                    continue;
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.