Package org.apache.geronimo.gbean

Examples of org.apache.geronimo.gbean.ReferenceCollectionListener


    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();
View Full Code Here

            listenerCopy = new ArrayList(listeners);
        }

        // fire the member added event
        for (Iterator iterator = listenerCopy.iterator(); iterator.hasNext();) {
            ReferenceCollectionListener listener = (ReferenceCollectionListener) iterator.next();
            try {
                listener.memberAdded(new ReferenceCollectionEvent(name, proxy));
            } catch (Throwable t) {
                log.error("Listener threw exception", t);
            }
        }
    }
View Full Code Here

            listenerCopy = new ArrayList(listeners);
        }

        // fire the member removed event
        for (Iterator iterator = listenerCopy.iterator(); iterator.hasNext();) {
            ReferenceCollectionListener listener = (ReferenceCollectionListener) iterator.next();
            try {
                listener.memberRemoved(new ReferenceCollectionEvent(name, proxy));
            } catch (Throwable t) {
                log.error("Listener threw exception", t);
            }
        }
View Full Code Here

    protected AbstractBuilderCollection(Collection<T> builders, final QName basePlanElementName) {
        this.builders = builders == null ? Collections.EMPTY_SET : builders;
        this.basePlanElementName = basePlanElementName;
        if (builders instanceof ReferenceCollection) {
            ((ReferenceCollection) builders).addReferenceCollectionListener(new ReferenceCollectionListener() {

                public void memberAdded(ReferenceCollectionEvent event) {
                    addBuilder((T) event.getMember());
                }
View Full Code Here

            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

            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

        }
        if (!datas.isEmpty()) {
            throw new IllegalStateException("Cannot resolve ServerInstanceDatas: " + datas);
        }
        if (serverInstanceDatas instanceof ReferenceCollection) {
            ((ReferenceCollection) serverInstanceDatas).addReferenceCollectionListener(new ReferenceCollectionListener() {

                public void memberAdded(ReferenceCollectionEvent event) {
                    ServerInstanceData instance = (ServerInstanceData) event.getMember();
                    try {
                        addServerInstance(instance, artifactManager, writeableRepo, serverInfo, servers, live);
View Full Code Here

        classLoader = null;
        for (ServerInstance instance : servers) {
            this.servers.put(instance.getServerName(), instance);
        }
        if (servers instanceof ReferenceCollection) {
            ((ReferenceCollection) servers).addReferenceCollectionListener(new ReferenceCollectionListener() {

                public void memberAdded(ReferenceCollectionEvent event) {
                    ServerInstance instance = (ServerInstance) event.getMember();
                    PluginInstallerGBean.this.servers.put(instance.getServerName(), instance);
                }
View Full Code Here

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

                public void memberAdded(ReferenceCollectionEvent event) {
                    ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
                    try {
                        Thread.currentThread().setContextClassLoader(EngineGBean.this.getClass().getClassLoader());
View Full Code Here

TOP

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

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.