public abstract class DefaultEndpoint
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.Endpoint, org.apache.camel.spi.HasId, org.apache.camel.CamelContextAware
isSynchronous() to determine
if asynchronous processing is allowed. The synchronous option on the
endpoint allows Camel end users to dictate whether they want the asynchronous
model or not. The option is default false which means asynchronous
processing is allowed.| Modifier | Constructor and Description |
|---|---|
protected |
DefaultEndpoint()
Constructs a partially-initialized DefaultEndpoint instance.
|
protected |
DefaultEndpoint(String endpointUri,
org.apache.camel.Component component)
Constructs a fully-initialized DefaultEndpoint instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureConsumer(org.apache.camel.Consumer consumer) |
protected void |
configurePollingConsumer(org.apache.camel.PollingConsumer consumer) |
void |
configureProperties(Map<String,Object> options) |
org.apache.camel.AsyncProducer |
createAsyncProducer() |
protected String |
createEndpointUri()
A factory method to lazily create the endpointUri if none is specified
|
org.apache.camel.Exchange |
createExchange() |
org.apache.camel.Exchange |
createExchange(org.apache.camel.ExchangePattern pattern) |
org.apache.camel.PollingConsumer |
createPollingConsumer() |
protected void |
doStart() |
protected void |
doStop() |
boolean |
equals(Object object) |
org.apache.camel.CamelContext |
getCamelContext() |
org.apache.camel.Component |
getComponent()
Returns the component that created this endpoint.
|
Map<String,Object> |
getConsumerProperties() |
String |
getEndpointKey() |
String |
getEndpointUri() |
org.apache.camel.spi.ExceptionHandler |
getExceptionHandler() |
org.apache.camel.ExchangePattern |
getExchangePattern()
Returns the default exchange pattern to use when creating an exchange.
|
String |
getId()
Returns a unique String ID which can be used for aliasing without having
to use the whole URI which is not unique
|
long |
getPollingConsumerBlockTimeout()
Sets the timeout in millis to use when adding to the internal queue off when
EventDrivenPollingConsumer
is being used. |
int |
getPollingConsumerQueueSize()
Gets the
PollingConsumer queue size, when EventDrivenPollingConsumer
is being used. |
int |
hashCode() |
boolean |
isBridgeErrorHandler() |
boolean |
isLenientProperties() |
boolean |
isPollingConsumerBlockWhenFull()
Whether to block when adding to the internal queue off when
EventDrivenPollingConsumer
is being used. |
boolean |
isSynchronous()
Returns whether synchronous processing should be strictly used.
|
void |
setBridgeErrorHandler(boolean bridgeErrorHandler)
Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while
the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and
handled by the routing Error Handler.
|
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
setConsumerProperties(Map<String,Object> consumerProperties) |
protected void |
setEndpointUri(String endpointUri)
Sets the URI that created this endpoint.
|
void |
setEndpointUriIfNotSpecified(String value)
Sets the endpointUri if it has not been specified yet via some kind of
dependency injection mechanism.
|
void |
setExceptionHandler(org.apache.camel.spi.ExceptionHandler exceptionHandler)
To let the consumer use a custom ExceptionHandler.
|
void |
setExchangePattern(org.apache.camel.ExchangePattern exchangePattern)
Sets the default exchange pattern when creating an exchange.
|
void |
setPollingConsumerBlockTimeout(long pollingConsumerBlockTimeout)
Sets the timeout in millis to use when adding to the internal queue off when
EventDrivenPollingConsumer
is being used. |
void |
setPollingConsumerBlockWhenFull(boolean pollingConsumerBlockWhenFull)
Set whether to block when adding to the internal queue off when
EventDrivenPollingConsumer
is being used. |
void |
setPollingConsumerQueueSize(int pollingConsumerQueueSize)
Sets the
PollingConsumer queue size, when EventDrivenPollingConsumer
is being used. |
protected void |
setProperties(Object bean,
Map<String,Object> parameters)
Sets the bean properties on the given bean.
|
void |
setSynchronous(boolean synchronous)
Sets whether synchronous processing should be strictly used, or Camel is
allowed to use asynchronous processing (if supported).
|
String |
toString() |
doInit, doResume, doShutdown, doSuspend, getStatus, init, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendprotected DefaultEndpoint(String endpointUri, org.apache.camel.Component component)
endpointUri - the full URI used to create this endpointcomponent - the component that created this endpointprotected DefaultEndpoint()
createEndpointUri() if one uses this constructor.
Note: It is preferred to create endpoints using the associated
component.public String getId()
getId in interface org.apache.camel.spi.HasIdpublic String getEndpointUri()
getEndpointUri in interface org.apache.camel.Endpointpublic String getEndpointKey()
getEndpointKey in interface org.apache.camel.Endpointpublic org.apache.camel.CamelContext getCamelContext()
getCamelContext in interface org.apache.camel.CamelContextAwaregetCamelContext in interface org.apache.camel.Endpointpublic org.apache.camel.AsyncProducer createAsyncProducer()
throws Exception
createAsyncProducer in interface org.apache.camel.EndpointExceptionpublic org.apache.camel.Component getComponent()
public void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext in interface org.apache.camel.CamelContextAwaresetCamelContext in interface org.apache.camel.Endpointpublic org.apache.camel.PollingConsumer createPollingConsumer()
throws Exception
createPollingConsumer in interface org.apache.camel.EndpointExceptionpublic org.apache.camel.Exchange createExchange()
createExchange in interface org.apache.camel.Endpointpublic org.apache.camel.Exchange createExchange(org.apache.camel.ExchangePattern pattern)
createExchange in interface org.apache.camel.Endpointpublic org.apache.camel.ExchangePattern getExchangePattern()
public void setExchangePattern(org.apache.camel.ExchangePattern exchangePattern)
public boolean isSynchronous()
public void setSynchronous(boolean synchronous)
synchronous - true to enforce synchronous processingpublic boolean isBridgeErrorHandler()
public void setBridgeErrorHandler(boolean bridgeErrorHandler)
public org.apache.camel.spi.ExceptionHandler getExceptionHandler()
public void setExceptionHandler(org.apache.camel.spi.ExceptionHandler exceptionHandler)
public int getPollingConsumerQueueSize()
PollingConsumer queue size, when EventDrivenPollingConsumer
is being used. Notice some Camel components may have their own implementation of PollingConsumer and
therefore not using the default EventDrivenPollingConsumer implementation.
The default value is 1000public void setPollingConsumerQueueSize(int pollingConsumerQueueSize)
PollingConsumer queue size, when EventDrivenPollingConsumer
is being used. Notice some Camel components may have their own implementation of PollingConsumer and
therefore not using the default EventDrivenPollingConsumer implementation.
The default value is 1000public boolean isPollingConsumerBlockWhenFull()
EventDrivenPollingConsumer
is being used. Notice some Camel components may have their own implementation of PollingConsumer and
therefore not using the default EventDrivenPollingConsumer implementation.
Setting this option to false, will result in an IllegalStateException being thrown
when trying to add to the queue, and its full.
The default value is true which will block the producer queue until the queue has space.public void setPollingConsumerBlockWhenFull(boolean pollingConsumerBlockWhenFull)
EventDrivenPollingConsumer
is being used. Notice some Camel components may have their own implementation of PollingConsumer and
therefore not using the default EventDrivenPollingConsumer implementation.
Setting this option to false, will result in an IllegalStateException being thrown
when trying to add to the queue, and its full.
The default value is true which will block the producer queue until the queue has space.public long getPollingConsumerBlockTimeout()
EventDrivenPollingConsumer
is being used.setPollingConsumerBlockWhenFull(boolean)public void setPollingConsumerBlockTimeout(long pollingConsumerBlockTimeout)
EventDrivenPollingConsumer
is being used.setPollingConsumerBlockWhenFull(boolean)public void configureProperties(Map<String,Object> options)
configureProperties in interface org.apache.camel.Endpointprotected void setProperties(Object bean, Map<String,Object> parameters) throws Exception
DefaultComponent.setProperties(Object, java.util.Map)bean - the beanparameters - properties to setExceptionprotected String createEndpointUri()
public void setEndpointUriIfNotSpecified(String value)
protected void setEndpointUri(String endpointUri)
public boolean isLenientProperties()
isLenientProperties in interface org.apache.camel.Endpointprotected void configureConsumer(org.apache.camel.Consumer consumer)
throws Exception
Exceptionprotected void configurePollingConsumer(org.apache.camel.PollingConsumer consumer)
throws Exception
Exceptionprotected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.ServiceSupportExceptionApache Camel