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