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 javax.xml.bind.annotation.XmlEnum;
020import javax.xml.bind.annotation.XmlType;
021
022/**
023 * Represents the kind of options for what to do with the current task when shutting down.
024 * <p/>
025 * By default the current task is allowed to complete. However some consumers such as
026 * {@link BatchConsumer} have pending tasks which you can configure the consumer 
027 * to complete as well.
028 * <ul>
029 *   <li>CompleteCurrentTaskOnly - Is the <b>default</b> behavior where a route consumer will be shutdown as fast as
030 *                                 possible. Allowing it to complete its current task, but not to pickup pending
031 *                                 tasks (if any).</li>
032 *   <li>CompleteAllTasks - Allows a route consumer to continue to complete all pending tasks (if any).</li> 
033 *                          
034 * </ul>
035 * <b>Notice:</b> Most consumers only have a single task, but {@link org.apache.camel.BatchConsumer} can have
036 * many tasks and thus this option mostly applies to this kind of consumer.
037 */
038@XmlType
039@XmlEnum
040public enum ShutdownRunningTask {
041
042    CompleteCurrentTaskOnly, CompleteAllTasks
043
044}