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 java.util.List;
020 import java.util.Map;
021
022 import org.apache.camel.spi.RouteContext;
023
024 public interface Route {
025
026 String ID_PROPERTY = "id";
027 String PARENT_PROPERTY = "parent";
028 String GROUP_PROPERTY = "group";
029
030 /**
031 * Gets the route id
032 *
033 * @return the route id
034 */
035 String getId();
036
037 /**
038 * Gets the inbound endpoint
039 */
040 Endpoint getEndpoint();
041
042 /**
043 * Gets the inbound {@link Consumer}
044 */
045 Consumer getConsumer();
046
047 /**
048 * This property map is used to associate information about the route.
049 *
050 * @return properties
051 */
052 Map<String, Object> getProperties();
053
054 /**
055 * Gets the route context
056 *
057 * @return the route context
058 */
059 RouteContext getRouteContext();
060
061 /**
062 * This property map is used to associate information about
063 * the route. Gets all the services for this routes
064 * </p>
065 * This implementation is used for initialization
066 *
067 * @return the services
068 * @throws Exception is thrown in case of error
069 * @deprecated will be removed in Camel 2.2
070 */
071 @Deprecated
072 List<Service> getServicesForRoute() throws Exception;
073
074 /**
075 * A strategy callback allowing special initialization when services is starting.
076 *
077 * @param services the service
078 * @throws Exception is thrown in case of error
079 */
080 void onStartingServices(List<Service> services) throws Exception;
081
082 /**
083 * Returns the services for this particular route
084 */
085 List<Service> getServices();
086
087 /**
088 * Adds a service to this route
089 *
090 * @param service the service
091 */
092 void addService(Service service);
093
094 /**
095 * Returns a navigator to navigate this route by navigating all the {@link Processor}s.
096 *
097 * @return a navigator for {@link Processor}.
098 */
099 Navigate<Processor> navigate();
100
101 }