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
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 */
025public interface RuntimeConfiguration {
026
027    /**
028     * Sets whether stream caching is enabled or not (default is disabled).
029     *
030     * @param cache whether stream caching is enabled or not
031     */
032    void setStreamCaching(Boolean cache);
033
034    /**
035     * Returns whether stream cache is enabled
036     *
037     * @return <tt>true</tt> if stream cache is enabled
038     */
039    Boolean isStreamCaching();
040
041    /**
042     * Sets whether tracing is enabled or not (default is disabled).
043     *
044     * @param tracing whether to enable tracing.
045     */
046    void setTracing(Boolean tracing);
047
048    /**
049     * Returns whether tracing enabled
050     *
051     * @return <tt>true</tt> if tracing is enabled
052     */
053    Boolean isTracing();
054
055    /**
056     * Sets whether message history is enabled or not (default is enabled).
057     *
058     * @param messageHistory whether message history is enabled
059     */
060    void setMessageHistory(Boolean messageHistory);
061
062    /**
063     * Returns whether message history is enabled
064     *
065     * @return <tt>true</tt> if message history is enabled
066     */
067    Boolean isMessageHistory();
068
069    /**
070     * Sets whether security mask for Logging is enabled or not (default is disabled).
071     * 
072     * @param logMask <tt>true</tt> if mask is enabled
073     */
074    void setLogMask(Boolean logMask);
075
076    /**
077     * Gets whether security mask for Logging is enabled or not.
078     * 
079     * @return <tt>true</tt> if mask is enabled
080     */
081    Boolean isLogMask();
082
083    /**
084     * Sets whether to log exhausted message body with message history.
085     *
086     * @param logExhaustedMessageBody whether message body should be logged
087     */
088    void setLogExhaustedMessageBody(Boolean logExhaustedMessageBody);
089
090    /**
091     * Returns whether to log exhausted message body with message history.
092     * 
093     * @return <tt>true</tt> if logging of message body is enabled
094     */
095    Boolean isLogExhaustedMessageBody();
096
097    /**
098     * Sets whether fault handling is enabled or not (default is disabled).
099     *
100     * @param handleFault whether to enable fault handling.
101     */
102    void setHandleFault(Boolean handleFault);
103
104    /**
105     * Returns whether fault handling enabled
106     *
107     * @return <tt>true</tt> if fault handling is enabled
108     */
109    Boolean isHandleFault();
110
111    /**
112     * Sets a delay value in millis that a message is delayed at every step it takes in the route path,
113     * slowing the process down to better observe what is occurring
114     * <p/>
115     * Is disabled by default
116     *
117     * @param delay delay in millis
118     */
119    void setDelayer(Long delay);
120
121    /**
122     * Gets the delay value
123     *
124     * @return delay in millis, or <tt>null</tt> if disabled
125     */
126    Long getDelayer();
127
128    /**
129     * Sets whether the object should automatically start when Camel starts.
130     * <p/>
131     * <b>Important:</b> Currently only routes can be disabled, as {@link CamelContext}s are always started.
132     * <br/>
133     * <b>Note:</b> When setting auto startup <tt>false</tt> on {@link CamelContext} then that takes precedence
134     * and <i>no</i> routes is started. You would need to start {@link CamelContext} explicit using
135     * the {@link org.apache.camel.CamelContext#start()} method, to start the context, and then
136     * you would need to start the routes manually using {@link CamelContext#startRoute(String)}.
137     * <p/>
138     * Default is <tt>true</tt> to always start up.
139     *
140     * @param autoStartup whether to start up automatically.
141     */
142    void setAutoStartup(Boolean autoStartup);
143
144    /**
145     * Gets whether the object should automatically start when Camel starts.
146     * <p/>
147     * <b>Important:</b> Currently only routes can be disabled, as {@link CamelContext}s are always started.
148     * <br/>
149     * Default is <tt>true</tt> to always start up.
150     *
151     * @return <tt>true</tt> if object should automatically start
152     */
153    Boolean isAutoStartup();
154
155    /**
156     * Sets the ShutdownRoute option for routes.
157     *
158     * @param shutdownRoute the option to use.
159     */
160    void setShutdownRoute(ShutdownRoute shutdownRoute);
161
162    /**
163     * Gets the option to use when shutting down the route.
164     *
165     * @return the option
166     */
167    ShutdownRoute getShutdownRoute();
168
169    /**
170     * Sets the ShutdownRunningTask option to use when shutting down a route.
171     *
172     * @param shutdownRunningTask the option to use.
173     */
174    void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask);
175
176    /**
177     * Gets the ShutdownRunningTask option in use when shutting down a route.
178     *
179     * @return the option
180     */
181    ShutdownRunningTask getShutdownRunningTask();
182
183    /**
184     * Sets whether to allow access to the original message from Camel's error handler,
185     * or from {@link org.apache.camel.spi.UnitOfWork#getOriginalInMessage()}.
186     * <p/>
187     * Turning this off can optimize performance, as defensive copy of the original message is not needed.
188     *
189     * @param allowUseOriginalMessage the option to use.
190     */
191    void setAllowUseOriginalMessage(Boolean allowUseOriginalMessage);
192
193    /**
194     * Sets whether to allow access to the original message from Camel's error handler,
195     * or from {@link org.apache.camel.spi.UnitOfWork#getOriginalInMessage()}.
196     * <p/>
197     * Turning this off can optimize performance, as defensive copy of the original message is not needed.
198     *
199     * @return the option
200     */
201    Boolean isAllowUseOriginalMessage();
202
203}