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 */ 017 package org.apache.camel; 018 019 import javax.xml.bind.annotation.XmlEnum; 020 import 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} has pending tasks which you can configure to 027 * let it complete all those tasks 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 do <i>do its business</i> which means that it will continue 033 * to complete any pending tasks (if any).</li> 034 * </ul> 035 * <b>Notice:</b> Most consumers only have a single tasks, but {@link org.apache.camel.BatchConsumer} can have 036 * many tasks and thus this option mostly apply to these kind of consumers. 037 */ 038 @XmlType 039 @XmlEnum(String.class) 040 public enum ShutdownRunningTask { 041 042 CompleteCurrentTaskOnly, CompleteAllTasks 043 044 }