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 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 likes.
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 * Is disabled by default
031 *
032 * @param cache whether stream caching is enabled or not
033 */
034 void setStreamCaching(Boolean cache);
035
036 /**
037 * Returns whether stream cache is enabled
038 *
039 * @return true if stream cache is enabled
040 */
041 Boolean isStreamCaching();
042
043 /**
044 * Sets whether tracing is enabled or not (default is disabled).
045 * <p/>
046 * Is disabled by default
047 *
048 * @param tracing whether tracing is enabled or not.
049 */
050 void setTracing(Boolean tracing);
051
052 /**
053 * Returns whether tracing enabled
054 *
055 * @return true if tracing is enabled
056 */
057 Boolean isTracing();
058
059 /**
060 * Sets whether handle fault is enabled or not (default is disabled).
061 * <p/>
062 * Is disabled by default
063 *
064 * @param handleFault whether handle fault is enabled or not.
065 */
066 void setHandleFault(Boolean handleFault);
067
068 /**
069 * Returns whether tracing enabled
070 *
071 * @return true if tracing is enabled
072 */
073 Boolean isHandleFault();
074
075 /**
076 * Sets a delay value in millis that a message is delayed at every step it takes in the route path,
077 * to slow things down to better helps you to see what goes
078 * <p/>
079 * Is disabled by default
080 *
081 * @param delay delay in millis
082 */
083 void setDelayer(Long delay);
084
085 /**
086 * Gets the delay value
087 *
088 * @return delay in millis, or <tt>null</tt> if disabled
089 */
090 Long getDelayer();
091
092 /**
093 * Sets whether it should automatic start when Camel starts.
094 * <p/>
095 * Currently only routes can be disabled, as {@link CamelContext} itself are always started}
096 * <br/>
097 * Default is true to always startup.
098 *
099 * @param autoStartup whether to auto startup.
100 */
101 void setAutoStartup(Boolean autoStartup);
102
103 /**
104 * Gets whether it should automatic start when Camel starts.
105 *
106 * @return true if should auto start
107 */
108 Boolean isAutoStartup();
109
110 /**
111 * Sets the option to use when shutting down routes.
112 *
113 * @param shutdownRoute the option to use.
114 */
115 void setShutdownRoute(ShutdownRoute shutdownRoute);
116
117 /**
118 * Gets the option to use when shutting down route.
119 *
120 * @return the option
121 */
122 ShutdownRoute getShutdownRoute();
123
124 /**
125 * Sets the option to use when shutting down a route and how to act when it has running tasks.
126 * <p/>
127 * A running task is for example a {@link org.apache.camel.BatchConsumer} which has a group
128 * of messages to process. With this option you can control whether it should complete the entire
129 * group or stop after the current message has been processed.
130 *
131 * @param shutdownRunningTask the option to use.
132 */
133 void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask);
134
135 /**
136 * Gets the option to use when shutting down a route and how to act when it has running tasks.
137 *
138 * @return the option
139 */
140 ShutdownRunningTask getShutdownRunningTask();
141
142 }