Package org.apache.cocoon.portal.event

Examples of org.apache.cocoon.portal.event.Subscriber


            Configuration[] rolesConf = roles.getChildren("role");
            for(int i=0; i<rolesConf.length;i++) {
                final Configuration current = rolesConf[i];
                final String name = current.getAttribute("name");
               
                Subscriber subscriber = null;
                try {
                    subscriber = (Subscriber) this.manager.lookup(name);
                    Deprecation.logger.warn("Subscriber is deprecated. Please convert the following component to a Receiver: " + subscriber.getClass().getName());
                    this.subscribe(subscriber);
                } finally {
                    this.manager.release(subscriber);
                }
            }
        }
        // subscribe all configured classes
        Configuration classes = this.configuration.getChild("subscriber-classes", false);
        if ( classes != null ) {
            Configuration[] classesConf = classes.getChildren("class");
            for(int i=0; i<classesConf.length;i++) {
                final Configuration current = classesConf[i];
                final String name = current.getAttribute("name");
               
                Deprecation.logger.warn("Subscriber is deprecated. Please convert the following component to a Receiver: " + name);
                Subscriber subscriber = (Subscriber) ClassUtils.newInstance(name);
                ContainerUtil.enableLogging(subscriber, this.getLogger());
                ContainerUtil.contextualize(subscriber, this.context);
                ContainerUtil.service(subscriber, this.manager );
                ContainerUtil.initialize(subscriber);
                this.subscribe(subscriber);
View Full Code Here


    public void send(Event event) {
        if ( getLogger().isDebugEnabled() ) {
            getLogger().debug("Publishing event " + event.getClass());
        }
        for ( Iterator e = subscribers.iterator(); e.hasNext(); ){
            Subscriber subscriber = (Subscriber)e.next();
            if (subscriber.getEventType().isAssignableFrom(event.getClass())
            && (subscriber.getFilter() == null || subscriber.getFilter().filter(event))) {
                if ( getLogger().isDebugEnabled() ) {
                    getLogger().info("Informing subscriber "+subscriber+" of event "+event.getClass());
                }
                subscriber.inform(event);
            }
        }
        for (Iterator re = receivers.entrySet().iterator(); re.hasNext(); ) {
            final Map.Entry current = (Map.Entry)re.next();
            final Receiver receiver = (Receiver)current.getKey();
View Full Code Here

            Configuration[] rolesConf = roles.getChildren("role");
            for(int i=0; i<rolesConf.length;i++) {
                final Configuration current = rolesConf[i];
                final String name = current.getAttribute("name");
               
                Subscriber subscriber = null;
                try {
                    subscriber = (Subscriber) this.manager.lookup(name);
                    Deprecation.logger.warn("Subscriber is deprecated. Please convert the following component to a Receiver: " + subscriber.getClass().getName());
                    this.subscribe(subscriber);
                } finally {
                    this.manager.release(subscriber);
                }
            }
        }
        // subscribe all configured classes
        Configuration classes = this.configuration.getChild("subscriber-classes", false);
        if ( classes != null ) {
            Configuration[] classesConf = classes.getChildren("class");
            for(int i=0; i<classesConf.length;i++) {
                final Configuration current = classesConf[i];
                final String name = current.getAttribute("name");
               
                Deprecation.logger.warn("Subscriber is deprecated. Please convert the following component to a Receiver: " + name);
                Subscriber subscriber = (Subscriber) ClassUtils.newInstance(name);
                ContainerUtil.enableLogging(subscriber, this.getLogger());
                ContainerUtil.contextualize(subscriber, this.context);
                ContainerUtil.service(subscriber, this.manager );
                ContainerUtil.initialize(subscriber);
                this.subscribe(subscriber);
View Full Code Here

    public void send(Event event) {
        if ( getLogger().isDebugEnabled() ) {
            getLogger().debug("Publishing event " + event.getClass());
        }
        for ( Iterator e = subscribers.iterator(); e.hasNext(); ){
            Subscriber subscriber = (Subscriber)e.next();
            if (subscriber.getEventType().isAssignableFrom(event.getClass())
            && (subscriber.getFilter() == null || subscriber.getFilter().filter(event))) {
                if ( getLogger().isDebugEnabled() ) {
                    getLogger().info("Informing subscriber "+subscriber+" of event "+event.getClass());
                }
                subscriber.inform(event);
            }
        }
        for (Iterator re = receivers.entrySet().iterator(); re.hasNext(); ) {
            final Map.Entry current = (Map.Entry)re.next();
            final Receiver receiver = (Receiver)current.getKey();
View Full Code Here

       
        if ( getLogger().isDebugEnabled() ) {
            getLogger().debug("Publishing event " + event.getClass());
        }
        for ( Iterator e = subscribers.iterator(); e.hasNext(); ){
            Subscriber subscriber = (Subscriber)e.next();
            if (subscriber.getEventType().isAssignableFrom(event.getClass())
            && (subscriber.getFilter() == null || subscriber.getFilter().filter(event))) {
                if ( getLogger().isDebugEnabled() ) {
                    getLogger().info("Informing subscriber "+subscriber+" of event "+event.getClass());
                }
                subscriber.inform(event);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.portal.event.Subscriber

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.