Package org.apache.camel.component.stub
Class StubComponent
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultComponent
org.apache.camel.component.seda.SedaComponent
org.apache.camel.component.stub.StubComponent
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.Component,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasCamelContext,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
@Component("stub")
public class StubComponent
extends org.apache.camel.component.seda.SedaComponent
The stub component is for stubbing out endpoints while developing or testing.
Allows you to easily stub out a middleware transport by prefixing the URI with "stub:" which is handy for testing out
routes, or isolating bits of middleware.
-
Field Summary
Fields inherited from class org.apache.camel.component.seda.SedaComponent
concurrentConsumers, defaultQueueFactory, log, maxConcurrentConsumers, queueSizeFields 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StubEndpointcreateEndpoint(String endpointUri, org.apache.camel.Component component, BlockingQueue<org.apache.camel.Exchange> queue, int concurrentConsumers) protected StubEndpointcreateEndpoint(String endpointUri, org.apache.camel.Component component, org.apache.camel.component.seda.BlockingQueueFactory<org.apache.camel.Exchange> queueFactory, int concurrentConsumers) protected voiddoInit()booleanisShadow()protected StringresolveShadowUri(String uri) Strategy to resolve the shadow uri to use for the stub endpointsprotected voidsetProperties(org.apache.camel.Endpoint endpoint, Map<String, Object> parameters) voidsetShadow(boolean shadow) If shadow is enabled then the stub component will register a shadow endpoint with the actual uri that refers to the stub endpoint, meaning you can lookup the endpoint via both stub:kafka:cheese and kafka:cheese.voidsetShadowPattern(String shadowPattern) If shadow is enabled then this pattern can be used to filter which components to match.protected voidprotected voidMethods inherited from class org.apache.camel.component.seda.SedaComponent
createEndpoint, doStop, getConcurrentConsumers, getDefaultOfferTimeout, getDefaultPollTimeout, getDefaultQueueFactory, getOrCreateQueue, getQueueKey, getQueueReference, getQueues, getQueueSize, isDefaultBlockWhenFull, isDefaultDiscardWhenFull, registerQueue, setConcurrentConsumers, setDefaultBlockWhenFull, setDefaultDiscardWhenFull, setDefaultOfferTimeout, setDefaultPollTimeout, setDefaultQueueFactory, setQueueSizeMethods inherited from class org.apache.camel.support.DefaultComponent
afterConfiguration, createEndpoint, createEndpoint, doBuild, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getDefaultName, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, useIntrospectionOnEndpoint, useRawUriMethods inherited from class org.apache.camel.support.service.BaseService
build, doFail, doLifecycleChange, doResume, doShutdown, doStart, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
StubComponent
public StubComponent()
-
-
Method Details
-
validateURI
- Overrides:
validateURIin classorg.apache.camel.support.DefaultComponent
-
validateParameters
- Overrides:
validateParametersin classorg.apache.camel.support.DefaultComponent
-
setProperties
protected void setProperties(org.apache.camel.Endpoint endpoint, Map<String, Object> parameters) throws Exception- Overrides:
setPropertiesin classorg.apache.camel.support.DefaultComponent- Throws:
Exception
-
createEndpoint
protected StubEndpoint createEndpoint(String endpointUri, org.apache.camel.Component component, org.apache.camel.component.seda.BlockingQueueFactory<org.apache.camel.Exchange> queueFactory, int concurrentConsumers) - Overrides:
createEndpointin classorg.apache.camel.component.seda.SedaComponent
-
createEndpoint
protected StubEndpoint createEndpoint(String endpointUri, org.apache.camel.Component component, BlockingQueue<org.apache.camel.Exchange> queue, int concurrentConsumers) - Overrides:
createEndpointin classorg.apache.camel.component.seda.SedaComponent
-
resolveShadowUri
Strategy to resolve the shadow uri to use for the stub endpoints -
isShadow
public boolean isShadow() -
setShadow
public void setShadow(boolean shadow) If shadow is enabled then the stub component will register a shadow endpoint with the actual uri that refers to the stub endpoint, meaning you can lookup the endpoint via both stub:kafka:cheese and kafka:cheese. -
getShadowPattern
-
setShadowPattern
If shadow is enabled then this pattern can be used to filter which components to match. Multiple patterns can be separated by comma.- See Also:
-
doInit
- Overrides:
doInitin classorg.apache.camel.support.DefaultComponent- Throws:
Exception
-