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 /** 020 * Various runtime configuration options used by {@link org.apache.camel.CamelContext} and {@link org.apache.camel.spi.RouteContext} 021 * for cross cutting functions such as tracing, delayer, stream cache and the like. 022 * 023 * @version 024 */ 025 public interface RuntimeConfiguration { 026 027 /** 028 * Sets whether stream caching is enabled or not (default is disabled). 029 * <p/> 030 * 031 * @param cache whether stream caching is enabled or not 032 */ 033 void setStreamCaching(Boolean cache); 034 035 /** 036 * Returns whether stream cache is enabled 037 * 038 * @return true if stream cache is enabled 039 */ 040 Boolean isStreamCaching(); 041 042 /** 043 * Sets whether tracing is enabled or not (default is disabled). 044 * <p/> 045 * 046 * @param tracing whether to enable tracing. 047 */ 048 void setTracing(Boolean tracing); 049 050 /** 051 * Returns whether tracing enabled 052 * 053 * @return true if tracing is enabled 054 */ 055 Boolean isTracing(); 056 057 /** 058 * Sets whether fault handling is enabled or not (default is disabled). 059 * <p/> 060 * 061 * @param handleFault whether to enable fault handling. 062 */ 063 void setHandleFault(Boolean handleFault); 064 065 /** 066 * Returns whether fault handling enabled 067 * 068 * @return true if fault handling is enabled 069 */ 070 Boolean isHandleFault(); 071 072 /** 073 * Sets a delay value in millis that a message is delayed at every step it takes in the route path, 074 * slowing the process down to better observe what is occurring 075 * <p/> 076 * Is disabled by default 077 * 078 * @param delay delay in millis 079 */ 080 void setDelayer(Long delay); 081 082 /** 083 * Gets the delay value 084 * 085 * @return delay in millis, or <tt>null</tt> if disabled 086 */ 087 Long getDelayer(); 088 089 /** 090 * Sets whether the object should automatically start when Camel starts. 091 * <p/> 092 * Currently only routes can be disabled, as {@link CamelContext}s are always started. 093 * <br/> 094 * Default is true to always start up. 095 * 096 * @param autoStartup whether to start up automatically. 097 */ 098 void setAutoStartup(Boolean autoStartup); 099 100 /** 101 * Gets whether the object should automatically start when Camel starts. 102 * 103 * @return true if object should automatically start 104 */ 105 Boolean isAutoStartup(); 106 107 /** 108 * Sets the ShutdownRoute option for routes. 109 * 110 * @param shutdownRoute the option to use. 111 */ 112 void setShutdownRoute(ShutdownRoute shutdownRoute); 113 114 /** 115 * Gets the option to use when shutting down the route. 116 * 117 * @return the option 118 */ 119 ShutdownRoute getShutdownRoute(); 120 121 /** 122 * Sets the ShutdownRunningTask option to use when shutting down a route. 123 * <p/> 124 * 125 * @param shutdownRunningTask the option to use. 126 */ 127 void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask); 128 129 /** 130 * Gets the ShutdownRunningTask option in use when shutting down a route. 131 * 132 * @return the option 133 */ 134 ShutdownRunningTask getShutdownRunningTask(); 135 136 }