Class DynamicRouterEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.component.dynamicrouter.DynamicRouterEndpoint
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="3.15.0", scheme="dynamic-router", title="Dynamic Router", syntax="dynamic-router:channel", alternativeSyntax="dynamic-router:channel/controlAction/subscribeChannel", producerOnly=true, category={ENDPOINT,JAVA}) public class DynamicRouterEndpoint extends org.apache.camel.support.DefaultEndpoint
The Dynamic Router component routes exchanges to recipients, and the recipients (and their rules) may change at runtime.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DynamicRouterEndpoint.DynamicRouterEndpointFactory
Create aDynamicRouterEndpoint
instance.
-
Constructor Summary
Constructors Constructor Description DynamicRouterEndpoint(String uri, DynamicRouterComponent component, DynamicRouterConfiguration configuration, Supplier<DynamicRouterControlChannelProcessor.DynamicRouterControlChannelProcessorFactory> processorFactorySupplier, Supplier<DynamicRouterControlProducer.DynamicRouterControlProducerFactory> controlProducerFactorySupplier)
Create the specialized endpoint for the Dynamic Router Control Channel.DynamicRouterEndpoint(String uri, DynamicRouterComponent component, DynamicRouterConfiguration configuration, Supplier<DynamicRouterProcessor.DynamicRouterProcessorFactory> processorFactorySupplier, Supplier<DynamicRouterProducer.DynamicRouterProducerFactory> producerFactorySupplier, Supplier<PrioritizedFilterProcessor.PrioritizedFilterProcessorFactory> filterProcessorFactorySupplier)
Create the Dynamic RouterEndpoint
for the given endpoint URI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.Consumer
createConsumer(org.apache.camel.Processor processor)
This is a producer-only component.org.apache.camel.Producer
createProducer()
Calls theDynamicRouterProducer.DynamicRouterProducerFactory
to create aDynamicRouterProducer
instance.protected void
doInit()
DynamicRouterConfiguration
getConfiguration()
Gets theDynamicRouterConfiguration
.DynamicRouterComponent
getDynamicRouterComponent()
A convenience method that wraps the parent method and casts to theDynamicRouterComponent
implementation.void
setConfiguration(DynamicRouterConfiguration configuration)
Set theDynamicRouterConfiguration
.-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
DynamicRouterEndpoint
public DynamicRouterEndpoint(String uri, DynamicRouterComponent component, DynamicRouterConfiguration configuration, Supplier<DynamicRouterProcessor.DynamicRouterProcessorFactory> processorFactorySupplier, Supplier<DynamicRouterProducer.DynamicRouterProducerFactory> producerFactorySupplier, Supplier<PrioritizedFilterProcessor.PrioritizedFilterProcessorFactory> filterProcessorFactorySupplier)
Create the Dynamic RouterEndpoint
for the given endpoint URI. This includes the creation of aDynamicRouterProcessor
that is registered with the suppliedDynamicRouterComponent
.- Parameters:
uri
- the endpoint URIcomponent
- the Dynamic RouterComponent
configuration
- theDynamicRouterConfiguration
processorFactorySupplier
- creates theDynamicRouterProcessor
producerFactorySupplier
- creates theDynamicRouterProcessor
filterProcessorFactorySupplier
- creates thePrioritizedFilterProcessor
-
DynamicRouterEndpoint
public DynamicRouterEndpoint(String uri, DynamicRouterComponent component, DynamicRouterConfiguration configuration, Supplier<DynamicRouterControlChannelProcessor.DynamicRouterControlChannelProcessorFactory> processorFactorySupplier, Supplier<DynamicRouterControlProducer.DynamicRouterControlProducerFactory> controlProducerFactorySupplier)
Create the specialized endpoint for the Dynamic Router Control Channel.- Parameters:
uri
- the endpoint URIcomponent
- the Dynamic RouterComponent
configuration
- theDynamicRouterConfiguration
processorFactorySupplier
- creates theDynamicRouterControlChannelProcessor
controlProducerFactorySupplier
- creates theDynamicRouterProcessor
-
-
Method Detail
-
doInit
protected void doInit() throws Exception
- Overrides:
doInit
in classorg.apache.camel.support.DefaultEndpoint
- Throws:
Exception
-
createProducer
public org.apache.camel.Producer createProducer()
Calls theDynamicRouterProducer.DynamicRouterProducerFactory
to create aDynamicRouterProducer
instance.- Returns:
- a
DynamicRouterProducer
instance
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
This is a producer-only component.- Parameters:
processor
- not applicable to producer-only component- Returns:
- not applicable to producer-only component
-
getDynamicRouterComponent
public DynamicRouterComponent getDynamicRouterComponent()
A convenience method that wraps the parent method and casts to theDynamicRouterComponent
implementation.- Returns:
- the
DynamicRouterComponent
-
getConfiguration
public DynamicRouterConfiguration getConfiguration()
Gets theDynamicRouterConfiguration
.- Returns:
- the
DynamicRouterConfiguration
-
setConfiguration
public void setConfiguration(DynamicRouterConfiguration configuration)
Set theDynamicRouterConfiguration
.- Parameters:
configuration
- theDynamicRouterConfiguration
-
-