Package org.apache.geronimo.gbean

Examples of org.apache.geronimo.gbean.ReferenceCollection


            Registry.setServer(mbeanServerReference.getMBeanServer());
        }
       
        //Add the hosts
        if (hosts instanceof ReferenceCollection) {
            ReferenceCollection refs = (ReferenceCollection)hosts;
            refs.addReferenceCollectionListener(new ReferenceCollectionListener() {

                public void memberAdded(ReferenceCollectionEvent event) {
                    Object o = event.getMember();
                    ObjectRetriever objectRetriever = (ObjectRetriever) o;
                    String hostName = ((Host)objectRetriever.getInternalObject()).getName();
                    if (!hostName.equals(defaultHostName))
                        addHost(objectRetriever);
                }

                public void memberRemoved(ReferenceCollectionEvent event) {
                    Object o = event.getMember();
                    ObjectRetriever objectRetriever = (ObjectRetriever) o;
                    String hostName = ((Host)objectRetriever.getInternalObject()).getName();
                    if (!hostName.equals(defaultHostName))
                        removeHost(objectRetriever);
                }
            });
            Iterator iterator = refs.iterator();
            while (iterator.hasNext()){
                ObjectRetriever objRetriever = (ObjectRetriever)iterator.next();
                String hostName = ((Host)objRetriever.getInternalObject()).getName();
                if (!hostName.equals(defaultHostName))
                    addHost(objRetriever);
View Full Code Here


        if (persistenceUnitGBeans == null) {
            return;
        }

        if (persistenceUnitGBeans instanceof ReferenceCollection) {
            ReferenceCollection referenceCollection = (ReferenceCollection) persistenceUnitGBeans;
            referenceCollection.addReferenceCollectionListener(new ReferenceCollectionListener() {
                public void memberAdded(ReferenceCollectionEvent event) {
                    addPersistenceUnitGBean((PersistenceUnitGBean) event.getMember());
                }

                public void memberRemoved(ReferenceCollectionEvent event) {
View Full Code Here

        if (resourceAdapterWrappers == null) {
            return;
        }

        if (resourceAdapterWrappers instanceof ReferenceCollection) {
            ReferenceCollection referenceCollection = (ReferenceCollection) resourceAdapterWrappers;
            referenceCollection.addReferenceCollectionListener(new ReferenceCollectionListener() {
                public void memberAdded(ReferenceCollectionEvent event) {
                    addResourceAdapter((ResourceAdapterWrapper) event.getMember());
                }

                public void memberRemoved(ReferenceCollectionEvent event) {
View Full Code Here

    private final Map namespaceToBuilderMap = new HashMap();

    private String defaultNamespace;

    public SwitchingModuleBuilder(Collection builders) {
        ReferenceCollection buildersCollection = (ReferenceCollection) builders;
        buildersCollection.addReferenceCollectionListener(new ReferenceCollectionListener() {
            public void memberAdded(ReferenceCollectionEvent event) {
                ModuleBuilder builder = (ModuleBuilder) event.getMember();
                String namespace = builder.getSchemaNamespace();
                namespaceToBuilderMap.put(namespace, builder);
            }
View Full Code Here

            }
        }

        //Add the hosts
        if (hosts instanceof ReferenceCollection) {
            ReferenceCollection refs = (ReferenceCollection)hosts;
            refs.addReferenceCollectionListener(new ReferenceCollectionListener() {

                public void memberAdded(ReferenceCollectionEvent event) {
                    Object o = event.getMember();
                    ObjectRetriever objectRetriever = (ObjectRetriever) o;
                    String hostName = ((Host)objectRetriever.getInternalObject()).getName();
                    if (!hostName.equals(defaultHostName))
                        addHost(objectRetriever);
                }

                public void memberRemoved(ReferenceCollectionEvent event) {
                    Object o = event.getMember();
                    ObjectRetriever objectRetriever = (ObjectRetriever) o;
                    String hostName = ((Host)objectRetriever.getInternalObject()).getName();
                    if (!hostName.equals(defaultHostName))
                        removeHost(objectRetriever);
                }
            });
            Iterator iterator = refs.iterator();
            while (iterator.hasNext()){
                ObjectRetriever objRetriever = (ObjectRetriever)iterator.next();
                String hostName = ((Host)objRetriever.getInternalObject()).getName();
                if (!hostName.equals(defaultHostName))
                    addHost(objRetriever);
View Full Code Here

        assertNull(builder.getDeploymentPlan(null, jar, new ModuleIDBuilder()));
        jar.close();
    }

    public void testJavaBeanXmlAttribute() throws Exception {
        ReferenceCollection referenceCollection = new MockReferenceCollection();
        JavaBeanXmlAttributeBuilder javaBeanXmlAttributeBuilder = new JavaBeanXmlAttributeBuilder();
        //this is kind of cheating, we rely on the builder to iterate through existing members of the collection.
        referenceCollection.add(javaBeanXmlAttributeBuilder);
        Naming naming = new Jsr77Naming();
        new ServiceConfigBuilder(parentEnvironment, null, referenceCollection, null, naming);
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        final URL plan1 = cl.getResource("services/plan1.xml");
        ModuleDocument doc = ModuleDocument.Factory.parse(plan1);
View Full Code Here

    public void setConfigurations(Collection configurations) {
        SecurityManager sm = System.getSecurityManager();
        if (sm != null) sm.checkPermission(SecurityServiceImpl.CONFIGURE);

        if (configurations instanceof ReferenceCollection) {
            ReferenceCollection ref = (ReferenceCollection) configurations;
            ref.addReferenceCollectionListener(this);
        }

        this.configurations = configurations;

        for (Iterator iter = configurations.iterator(); iter.hasNext();) {
View Full Code Here

        if (persistenceUnitGBeans == null) {
            return;
        }

        if (persistenceUnitGBeans instanceof ReferenceCollection) {
            ReferenceCollection referenceCollection = (ReferenceCollection) persistenceUnitGBeans;
            referenceCollection.addReferenceCollectionListener(new ReferenceCollectionListener() {
                public void memberAdded(ReferenceCollectionEvent event) {
                    addPersistenceUnitGBean((PersistenceUnitGBean) event.getMember());
                }

                public void memberRemoved(ReferenceCollectionEvent event) {
View Full Code Here

        if (resourceAdapterWrappers == null) {
            return;
        }

        if (resourceAdapterWrappers instanceof ReferenceCollection) {
            ReferenceCollection referenceCollection = (ReferenceCollection) resourceAdapterWrappers;
            referenceCollection.addReferenceCollectionListener(new ReferenceCollectionListener() {
                public void memberAdded(ReferenceCollectionEvent event) {
                    addResourceAdapter((ResourceAdapterWrapper) event.getMember());
                }

                public void memberRemoved(ReferenceCollectionEvent event) {
View Full Code Here

        assertNull(builder.getDeploymentPlan(null, jar, new ModuleIDBuilder()));
        jar.close();
    }

    public void testJavaBeanXmlAttribute() throws Exception {
        ReferenceCollection referenceCollection = new MockReferenceCollection();
        JavaBeanXmlAttributeBuilder javaBeanXmlAttributeBuilder = new JavaBeanXmlAttributeBuilder();
        //this is kind of cheating, we rely on the builder to iterate through existing members of the collection.
        referenceCollection.add(javaBeanXmlAttributeBuilder);
        Naming naming = new Jsr77Naming();
        NamespaceDrivenBuilder gbeanBuilder = new GBeanBuilder(referenceCollection, null);
//        ConfigurationBuilder serviceBuilder = new ServiceConfigBuilder(parentEnvironment, null, Collections.singleton(gbeanBuilder), naming);
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        final URL plan1 = cl.getResource("services/plan1.xml");
View Full Code Here

TOP

Related Classes of org.apache.geronimo.gbean.ReferenceCollection

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.