Package org.apache.geronimo.kernel

Examples of org.apache.geronimo.kernel.DependencyManager


    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 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();
            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);
        }

        if (proxyTarget != null) {
            dependencyManager.removeDependency(objectName, proxyTarget);
            proxyTarget = null;
        }
    }
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.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

            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

        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());
                        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)) {
                        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.