1 /* 2 * Copyright 2009 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.openehealth.ipf.platform.camel.core.process; 17 18 import org.apache.camel.Exchange; 19 import org.apache.camel.Processor; 20 21 /** 22 * Provides an interceptor that can wrap the call to the next processor into 23 * custom logic. 24 */ 25 public interface Interceptor { 26 /** 27 * Called to process an exchange and to call the next processor in the route. 28 * @param exchange 29 * the exchange to process. 30 * @param next 31 * the next processor. 32 * @throws Exception 33 * any exception that occurred while processing the exchange. 34 */ 35 void process(Exchange exchange, Processor next); 36 }