Package org.apache.geronimo.gbean

Examples of org.apache.geronimo.gbean.GBeanData$PriorityComparator


  }

  public void addToViewGroups(CmsGroup group) {
    Set<CmsGroup> groups = getViewGroups();
    if (groups == null) {
      groups = new TreeSet<CmsGroup>(new PriorityComparator());
      setViewGroups(groups);
    }
    groups.add(group);
    group.getViewChannels().add(this);
  }
View Full Code Here


  }

  public void addToContriGroups(CmsGroup group) {
    Set<CmsGroup> groups = getContriGroups();
    if (groups == null) {
      groups = new TreeSet<CmsGroup>(new PriorityComparator());
      setContriGroups(groups);
    }
    groups.add(group);
    group.getContriChannels().add(this);
  }
View Full Code Here

  }

  public void addToUsers(CmsUser user) {
    Set<CmsUser> set = getUsers();
    if (set == null) {
      set = new TreeSet<CmsUser>(new PriorityComparator());
      setUsers(set);
    }
    set.add(user);
    user.addToChannels(this);
  }
View Full Code Here

    return ids;
  }
  public void addToViewChannels(Channel channel) {
    Set<Channel> channels = getViewChannels();
    if (channels == null) {
      channels = new TreeSet<Channel>(new PriorityComparator());
      setViewChannels(channels);
    }
    channels.add(channel);
    channel.getViewGroups().add(this);
  }
View Full Code Here

  }

  public void addToContriChannels(Channel channel) {
    Set<Channel> channels = getContriChannels();
    if (channels == null) {
      channels = new TreeSet<Channel>(new PriorityComparator());
      setContriChannels(channels);
    }
    channels.add(channel);
    channel.getContriGroups().add(this);
  }
View Full Code Here

                   beanInfo.getInterfaces().contains(WebServiceBuilder.class.getName()));
    }
   
    public void testConfigurePojo() throws Exception {
    
        GBeanData gbeanData = EasyMock.createMock(GBeanData.class);
        ClassLoader loader = EasyMock.createMock(ClassLoader.class);
       
        gbeanData.setAttribute("pojoClassName", Greeter.class.getName());
        loader.loadClass(Greeter.class.getName());
        EasyMock.expectLastCall().andReturn(Greeter.class);
        gbeanData.setAttribute(EasyMock.matches("webServiceContainer"),
                               EasyMock.isA(StoredObject.class));
      
        EasyMock.replay(gbeanData);
        mockBusFactory.replay();
      
View Full Code Here

            if (queryArtifact == null || queryArtifact.matches(configuration.getId())) {

                // Search the GBeans
                for (Map.Entry<AbstractName, GBeanData> entry : gbeanNames) {
                    AbstractName abstractName = entry.getKey();
                    GBeanData gbeanData = entry.getValue();
                    if (abstractNameQuery.matches(abstractName, gbeanData.getGBeanInfo().getInterfaces())) {
                        result.add(gbeanData);
                    }
                }
            }
        }
View Full Code Here

    }

    protected Configuration load(ConfigurationData configurationData, LinkedHashSet resolvedParentIds, Map loadedConfigurations) throws InvalidConfigException {
        Artifact configurationId = configurationData.getId();
        AbstractName configurationName = Configuration.getConfigurationAbstractName(configurationId);
        GBeanData gbeanData = new GBeanData(configurationName, Configuration.GBEAN_INFO);
        gbeanData.setAttribute("configurationData", configurationData);
        gbeanData.setAttribute("configurationResolver", new ConfigurationResolver(configurationData, repositories, getArtifactResolver()));
        //TODO is this dangerous?
        gbeanData.setAttribute("managedAttributeStore", attributeStore);

        // add parents to the parents reference collection
        LinkedHashSet parentNames = new LinkedHashSet();
        for (Iterator iterator = resolvedParentIds.iterator(); iterator.hasNext();) {
            Artifact resolvedParentId = (Artifact) iterator.next();
            AbstractName parentName = Configuration.getConfigurationAbstractName(resolvedParentId);
            parentNames.add(parentName);
        }
        gbeanData.addDependencies(parentNames);
        gbeanData.setReferencePatterns("Parents", parentNames);

        // load the configuration
        try {
            kernel.loadGBean(gbeanData, classLoader);
        } catch (GBeanAlreadyExistsException e) {
View Full Code Here

        Collection gbeans = configuration.getGBeans().values();

        // stop the gbeans
        for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
            GBeanData gbeanData = (GBeanData) iterator.next();
            AbstractName gbeanName = gbeanData.getAbstractName();
            try {
                kernel.stopGBean(gbeanName);
            } catch (GBeanNotFoundException ignored) {
            } catch (IllegalStateException ignored) {
            } catch (InternalKernelException kernelException) {
                log.debug("Error cleaning up after failed start of configuration " + configuration.getId() + " gbean " + gbeanName, kernelException);
            }
        }

        // unload the gbeans
        for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
            GBeanData gbeanData = (GBeanData) iterator.next();
            AbstractName gbeanName = gbeanData.getAbstractName();
            try {
                kernel.unloadGBean(gbeanName);
            } catch (GBeanNotFoundException ignored) {
            } catch (IllegalStateException ignored) {
            } catch (InternalKernelException kernelException) {
View Full Code Here

                    message.append(" gbeanName=").append(name);
                    throw new InvalidConfigException(message.toString());
                }
                GBeanInfo gbeanInfo = GBeanInfo.getGBeanInfo(gbean.getGBeanInfo(), classLoader);
                AbstractName abstractName = (AbstractName) name;
                GBeanData gBeanData = new GBeanData(abstractName, gbeanInfo);
                gbeanDatas.add(gBeanData);
            }
        }

        // set the attributes
        for (Iterator iterator = gbeanDatas.iterator(); iterator.hasNext();) {
            GBeanData data = (GBeanData) iterator.next();
            boolean load = setAttributes(data, configuration, configName, classLoader);
            if (!load) {
                iterator.remove();
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.gbean.GBeanData$PriorityComparator

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.