001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.camel.spi;
018    
019    import java.util.EventObject;
020    
021    /**
022     * Notifier to send {@link java.util.EventObject events}.
023     *
024     * @see org.apache.camel.spi.EventFactory
025     * @version 
026     */
027    public interface EventNotifier {
028    
029        /**
030         * Notifies the given event
031         *
032         * @param event the event
033         * @throws Exception can be thrown if notification failed
034         */
035        void notify(EventObject event) throws Exception;
036    
037        /**
038         * Checks whether notification for the given event is enabled.
039         * <p/>
040         * If disabled the event will not be sent and silently ignored instead.
041         *
042         * @param event the event
043         * @return <tt>true</tt> if the event should be sent, <tt>false</tt> to silently ignore it
044         */
045        boolean isEnabled(EventObject event);
046    
047        boolean isIgnoreCamelContextEvents();
048    
049        void setIgnoreCamelContextEvents(boolean ignoreCamelContextEvents);
050    
051        boolean isIgnoreRouteEvents();
052    
053        void setIgnoreRouteEvents(boolean ignoreRouteEvents);
054    
055        boolean isIgnoreServiceEvents();
056    
057        void setIgnoreServiceEvents(boolean ignoreServiceEvents);
058    
059        boolean isIgnoreExchangeEvents();
060    
061        void setIgnoreExchangeEvents(boolean ignoreExchangeEvents);
062    
063        boolean isIgnoreExchangeCreatedEvent();
064    
065        void setIgnoreExchangeCreatedEvent(boolean ignoreExchangeCreatedEvent);
066    
067        boolean isIgnoreExchangeCompletedEvent();
068    
069        void setIgnoreExchangeCompletedEvent(boolean ignoreExchangeCompletedEvent);
070    
071        boolean isIgnoreExchangeFailedEvents();
072    
073        void setIgnoreExchangeFailedEvents(boolean ignoreExchangeFailureEvents);
074    
075        boolean isIgnoreExchangeRedeliveryEvents();
076    
077        void setIgnoreExchangeRedeliveryEvents(boolean ignoreExchangeRedeliveryEvents);
078    
079        boolean isIgnoreExchangeSentEvents();
080    
081        void setIgnoreExchangeSentEvents(boolean ignoreExchangeSentEvents);
082    
083        boolean isIgnoreExchangeSendingEvents();
084    
085        void setIgnoreExchangeSendingEvents(boolean ignoreExchangeSendingEvents);
086    
087    }