Class KameletComponent

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Component, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @Component("kamelet")
    public class KameletComponent
    extends org.apache.camel.support.DefaultComponent
    The Kamelet Component provides support for materializing routes templates.
    • Field Summary

      • Fields inherited from class org.apache.camel.support.service.BaseService

        BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addConsumer​(String key, org.apache.camel.component.kamelet.KameletConsumer consumer)  
      void addKameletEip​(String key, org.apache.camel.Processor callback)  
      protected org.apache.camel.Endpoint createEndpoint​(String uri, String remaining, Map<String,​Object> parameters)  
      protected void doInit()  
      protected void doShutdown()  
      protected org.apache.camel.component.kamelet.KameletConsumer getConsumer​(String key, boolean block, long timeout)  
      org.apache.camel.Processor getKameletEip​(String key)  
      String getLocation()  
      Map<String,​Properties> getRouteProperties()  
      org.apache.camel.spi.RouteTemplateLoaderListener getRouteTemplateLoaderListener()  
      Map<String,​Properties> getTemplateProperties()  
      long getTimeout()  
      boolean isBlock()  
      void removeConsumer​(String key, org.apache.camel.component.kamelet.KameletConsumer consumer)  
      org.apache.camel.Processor removeKameletEip​(String key)  
      protected boolean resolveRawParameterValues()  
      void setBlock​(boolean block)
      If sending a message to a kamelet endpoint which has no active consumer, then we can tell the producer to block and wait for the consumer to become active.
      void setLocation​(String location)
      The location(s) of the Kamelets on the file system.
      void setRouteProperties​(Map<String,​Properties> routeProperties)
      Set route local parameters.
      void setRouteTemplateLoaderListener​(org.apache.camel.spi.RouteTemplateLoaderListener routeTemplateLoaderListener)
      To plugin a custom listener for when the Kamelet component is loading Kamelets from external resources.
      void setTemplateProperties​(Map<String,​Properties> templateProperties)
      Set template local parameters.
      void setTimeout​(long timeout)
      The timeout value to use if block is enabled.
      • Methods inherited from class org.apache.camel.support.DefaultComponent

        afterConfiguration, createEndpoint, createEndpoint, doBuild, doStart, doStop, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getDefaultName, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, setProperties, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doFail, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
      • Methods inherited from interface org.apache.camel.Service

        build, close, init, start, stop
      • Methods inherited from interface org.apache.camel.ShutdownableService

        shutdown
      • Methods inherited from interface org.apache.camel.StatefulService

        getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
      • Methods inherited from interface org.apache.camel.SuspendableService

        isSuspended, resume, suspend
    • Constructor Detail

      • KameletComponent

        public KameletComponent()
    • Method Detail

      • addKameletEip

        public void addKameletEip​(String key,
                                  org.apache.camel.Processor callback)
      • removeKameletEip

        public org.apache.camel.Processor removeKameletEip​(String key)
      • getKameletEip

        public org.apache.camel.Processor getKameletEip​(String key)
      • createEndpoint

        protected org.apache.camel.Endpoint createEndpoint​(String uri,
                                                           String remaining,
                                                           Map<String,​Object> parameters)
                                                    throws Exception
        Specified by:
        createEndpoint in class org.apache.camel.support.DefaultComponent
        Throws:
        Exception
      • resolveRawParameterValues

        protected boolean resolveRawParameterValues()
        Overrides:
        resolveRawParameterValues in class org.apache.camel.support.DefaultComponent
      • isBlock

        public boolean isBlock()
      • setBlock

        public void setBlock​(boolean block)
        If sending a message to a kamelet endpoint which has no active consumer, then we can tell the producer to block and wait for the consumer to become active.
      • getTimeout

        public long getTimeout()
      • setTimeout

        public void setTimeout​(long timeout)
        The timeout value to use if block is enabled.
      • setTemplateProperties

        public void setTemplateProperties​(Map<String,​Properties> templateProperties)
        Set template local parameters.
      • setRouteProperties

        public void setRouteProperties​(Map<String,​Properties> routeProperties)
        Set route local parameters.
      • getLocation

        public String getLocation()
      • setLocation

        public void setLocation​(String location)
        The location(s) of the Kamelets on the file system. Multiple locations can be set separated by comma.
      • getRouteTemplateLoaderListener

        public org.apache.camel.spi.RouteTemplateLoaderListener getRouteTemplateLoaderListener()
      • setRouteTemplateLoaderListener

        public void setRouteTemplateLoaderListener​(org.apache.camel.spi.RouteTemplateLoaderListener routeTemplateLoaderListener)
        To plugin a custom listener for when the Kamelet component is loading Kamelets from external resources.
      • addConsumer

        public void addConsumer​(String key,
                                org.apache.camel.component.kamelet.KameletConsumer consumer)
      • removeConsumer

        public void removeConsumer​(String key,
                                   org.apache.camel.component.kamelet.KameletConsumer consumer)
      • doInit

        protected void doInit()
                       throws Exception
        Overrides:
        doInit in class org.apache.camel.support.DefaultComponent
        Throws:
        Exception
      • doShutdown

        protected void doShutdown()
                           throws Exception
        Overrides:
        doShutdown in class org.apache.camel.support.service.BaseService
        Throws:
        Exception