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;
018
019import java.util.List;
020
021import org.apache.camel.spi.InterceptStrategy;
022import org.apache.camel.spi.RouteContext;
023
024/**
025 * Channel acts as a channel between {@link Processor}s in the route graph.
026 * <p/>
027 * The channel is responsible for routing the {@link Exchange} to the next {@link Processor} in the route graph.
028 */
029public interface Channel extends AsyncProcessor, Navigate<Processor> {
030
031    /**
032     * Gets the {@link org.apache.camel.processor.ErrorHandler} this Channel uses.
033     *
034     * @return the error handler, or <tt>null</tt> if no error handler is used.
035     */
036    Processor getErrorHandler();
037
038    /**
039     * Gets the wrapped output that at runtime should be delegated to.
040     *
041     * @return the output to route the {@link Exchange} to
042     */
043    Processor getOutput();
044
045    /**
046     * Gets the next {@link Processor} to route to (not wrapped)
047     *
048     * @return  the next processor
049     */
050    Processor getNextProcessor();
051
052    /**
053     * Gets the {@link RouteContext}
054     *
055     * @return the route context
056     */
057    RouteContext getRouteContext();
058
059    /**
060     * Gets the definition of the next processor
061     *
062     * @return the processor definition
063     */
064    NamedNode getProcessorDefinition();
065
066}