Class Main

    • Field Detail

      • instance

        protected static Main instance
      • mainClass

        protected Class<?> mainClass
    • Constructor Detail

      • Main

        public Main()
        Camel main application It is recommended to use Main(Class) to specify the main class.
      • Main

        public Main​(Class<?> mainClass)
        Camel main application
        Parameters:
        mainClass - the main class
      • Main

        @SafeVarargs
        public Main​(Class<?> mainClass,
                    Class<org.apache.camel.CamelConfiguration>... configurationClasses)
        Camel main application
        Parameters:
        mainClass - the main class
        configurationClasses - additional camel configuration classes
    • Method Detail

      • getInstance

        public static Main getInstance()
        Returns the currently executing main
        Returns:
        the current running instance
      • bind

        public void bind​(String name,
                         Object bean)
        Binds the given name to the bean object, so that it can be looked up inside the CamelContext this command line tool runs with.
        Parameters:
        name - the used name through which we do bind
        bean - the object to bind
      • lookup

        public Object lookup​(String name)
        Using the given name does lookup for the bean being already bound using the bind(String, Object) method.
        See Also:
        BeanRepository.lookupByName(String)
      • lookup

        public <T> T lookup​(String name,
                            Class<T> type)
        Using the given name and type does lookup for the bean being already bound using the bind(String, Object) method.
        See Also:
        BeanRepository.lookupByNameAndType(String, Class)
      • lookupByType

        public <T> Map<String,​T> lookupByType​(Class<T> type)
        Using the given type does lookup for the bean being already bound using the bind(String, Object) method.
        See Also:
        BeanRepository.findByTypeWithName(Class)