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 */
017package org.apache.camel.spi;
018
019import 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 */
027public 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    /**
048     * Checks whether notification is disabled for all events
049     *
050     * @return <tt>true</tt> if disabled and no events is being notified.
051     */
052    boolean isDisabled();
053
054    boolean isIgnoreCamelContextEvents();
055
056    void setIgnoreCamelContextEvents(boolean ignoreCamelContextEvents);
057
058    boolean isIgnoreRouteEvents();
059
060    void setIgnoreRouteEvents(boolean ignoreRouteEvents);
061
062    boolean isIgnoreServiceEvents();
063
064    void setIgnoreServiceEvents(boolean ignoreServiceEvents);
065
066    boolean isIgnoreExchangeEvents();
067
068    void setIgnoreExchangeEvents(boolean ignoreExchangeEvents);
069
070    boolean isIgnoreExchangeCreatedEvent();
071
072    void setIgnoreExchangeCreatedEvent(boolean ignoreExchangeCreatedEvent);
073
074    boolean isIgnoreExchangeCompletedEvent();
075
076    void setIgnoreExchangeCompletedEvent(boolean ignoreExchangeCompletedEvent);
077
078    boolean isIgnoreExchangeFailedEvents();
079
080    void setIgnoreExchangeFailedEvents(boolean ignoreExchangeFailureEvents);
081
082    boolean isIgnoreExchangeRedeliveryEvents();
083
084    void setIgnoreExchangeRedeliveryEvents(boolean ignoreExchangeRedeliveryEvents);
085
086    boolean isIgnoreExchangeSentEvents();
087
088    void setIgnoreExchangeSentEvents(boolean ignoreExchangeSentEvents);
089
090    boolean isIgnoreExchangeSendingEvents();
091
092    void setIgnoreExchangeSendingEvents(boolean ignoreExchangeSendingEvents);
093
094}