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 019/** 020 * Notifier to send {@link java.util.EventObject events}. 021 * 022 * @see org.apache.camel.spi.EventFactory 023 */ 024public interface EventNotifier { 025 026 /** 027 * Notifies the given event 028 * 029 * @param event the event 030 * @throws Exception can be thrown if notification failed 031 */ 032 void notify(CamelEvent event) throws Exception; 033 034 /** 035 * Checks whether notification for the given event is enabled. 036 * <p/> 037 * If disabled the event will not be sent and silently ignored instead. 038 * 039 * @param event the event 040 * @return <tt>true</tt> if the event should be sent, <tt>false</tt> to silently ignore it 041 */ 042 boolean isEnabled(CamelEvent event); 043 044 /** 045 * Checks whether notification is disabled for all events 046 * 047 * @return <tt>true</tt> if disabled and no events is being notified. 048 */ 049 boolean isDisabled(); 050 051 boolean isIgnoreCamelContextEvents(); 052 053 void setIgnoreCamelContextEvents(boolean ignoreCamelContextEvents); 054 055 boolean isIgnoreRouteEvents(); 056 057 void setIgnoreRouteEvents(boolean ignoreRouteEvents); 058 059 boolean isIgnoreServiceEvents(); 060 061 void setIgnoreServiceEvents(boolean ignoreServiceEvents); 062 063 boolean isIgnoreExchangeEvents(); 064 065 void setIgnoreExchangeEvents(boolean ignoreExchangeEvents); 066 067 boolean isIgnoreExchangeCreatedEvent(); 068 069 void setIgnoreExchangeCreatedEvent(boolean ignoreExchangeCreatedEvent); 070 071 boolean isIgnoreExchangeCompletedEvent(); 072 073 void setIgnoreExchangeCompletedEvent(boolean ignoreExchangeCompletedEvent); 074 075 boolean isIgnoreExchangeFailedEvents(); 076 077 void setIgnoreExchangeFailedEvents(boolean ignoreExchangeFailureEvents); 078 079 boolean isIgnoreExchangeRedeliveryEvents(); 080 081 void setIgnoreExchangeRedeliveryEvents(boolean ignoreExchangeRedeliveryEvents); 082 083 boolean isIgnoreExchangeSentEvents(); 084 085 void setIgnoreExchangeSentEvents(boolean ignoreExchangeSentEvents); 086 087 boolean isIgnoreExchangeSendingEvents(); 088 089 void setIgnoreExchangeSendingEvents(boolean ignoreExchangeSendingEvents); 090 091 boolean isIgnoreStepEvents(); 092 093 void setIgnoreStepEvents(boolean ignoreStepEvents); 094 095}