|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultEndpoint
public abstract class DefaultEndpoint
A default endpoint useful for implementation inheritance.
Components which leverages asynchronous processing model should check theisSynchronous() 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.
| Constructor Summary | |
|---|---|
protected |
DefaultEndpoint()
Constructs a partially-initialized DefaultEndpoint instance. |
protected |
DefaultEndpoint(String endpointUri)
Constructs a partially-initialized DefaultEndpoint instance. |
protected |
DefaultEndpoint(String endpointUri,
CamelContext camelContext)
Constructs a DefaultEndpoint instance which has not been created using a Component. |
protected |
DefaultEndpoint(String endpointUri,
Component component)
Constructs a fully-initialized DefaultEndpoint instance. |
| Method Summary | |
|---|---|
void |
configureProperties(Map<String,Object> options)
Configure properties on this endpoint. |
protected String |
createEndpointUri()
A factory method to lazily create the endpointUri if none is specified |
Exchange |
createExchange()
Create a new exchange for communicating with this endpoint |
Exchange |
createExchange(Exchange exchange)
Creates a new exchange for communicating with this exchange using the given exchange to pre-populate the values of the headers and messages |
Exchange |
createExchange(ExchangePattern pattern)
Create a new exchange for communicating with this endpoint with the specified ExchangePattern such as whether its going
to be an ExchangePattern.InOnly or ExchangePattern.InOut exchange |
PollingConsumer |
createPollingConsumer()
Creates a new Polling Consumer so that the caller can poll message exchanges from the consumer using PollingConsumer.receive(),
PollingConsumer.receiveNoWait() or
PollingConsumer.receive(long) whenever it is ready to do so
rather than using the Event
Based Consumer returned by Endpoint.createConsumer(Processor) |
protected void |
doStart()
|
protected void |
doStop()
|
boolean |
equals(Object object)
|
CamelContext |
getCamelContext()
Returns the context which created the endpoint |
Component |
getComponent()
Returns the component that created this endpoint. |
String |
getEndpointKey()
Returns a string key of this endpoint. |
String |
getEndpointUri()
Returns the string representation of the endpoint URI |
ExchangePattern |
getExchangePattern()
Returns the default exchange pattern to use for createExchange(). |
Class<Exchange> |
getExchangeType()
Returns the type of the exchange which is generated by this component |
String |
getId()
Returns a unique String ID which can be used for aliasing without having to use the whole URI which is not unique |
int |
hashCode()
|
boolean |
isLenientProperties()
Should all properties be known or does the endpoint allow unknown options? lenient = false means that the endpoint should validate that all given options is known and configured properly. |
boolean |
isSynchronous()
Returns whether synchronous processing should be strictly used. |
static String |
sanitizeUri(String uri)
Removes detected sensitive information (such as passwords) from the URI and returns the result. |
void |
setCamelContext(CamelContext camelContext)
Sets the camel context. |
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 |
setExchangePattern(ExchangePattern exchangePattern)
Sets the default exchange pattern to use for createExchange(). |
void |
setSynchronous(boolean synchronous)
Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). |
String |
toString()
|
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
|---|
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.camel.Endpoint |
|---|
createConsumer, createProducer |
| Methods inherited from interface org.apache.camel.IsSingleton |
|---|
isSingleton |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Constructor Detail |
|---|
protected DefaultEndpoint(String endpointUri,
Component component)
endpointUri - the full URI used to create this endpointcomponent - the component that created this endpoint
protected DefaultEndpoint(String endpointUri,
CamelContext camelContext)
Component.
Note: It is preferred to create endpoints using the associated component.
endpointUri - the full URI used to create this endpointcamelContext - the Camel Context in which this endpoint is operatingprotected DefaultEndpoint(String endpointUri)
endpointUri - the full URI used to create this endpointprotected DefaultEndpoint()
createEndpointUri() if one uses this constructor.
Note: It is preferred to create endpoints using the associated component.
| Method Detail |
|---|
public int hashCode()
hashCode in class Objectpublic boolean equals(Object object)
equals in class Objectpublic String toString()
toString in class Objectpublic String getId()
getId in interface HasIdpublic String getEndpointUri()
Endpoint
getEndpointUri in interface Endpointpublic String getEndpointKey()
EndpointLifecycleStrategy when registering endpoint.
This allows to register different instances of endpoints with the same key.
For JMX mbeans this allows us to use the same JMX Mbean for all endpoints that are logical
the same but have different parameters. For instance the http endpoint.
getEndpointKey in interface Endpointpublic CamelContext getCamelContext()
Endpoint
getCamelContext in interface CamelContextAwaregetCamelContext in interface Endpointpublic Component getComponent()
public void setCamelContext(CamelContext camelContext)
Endpoint
setCamelContext in interface CamelContextAwaresetCamelContext in interface EndpointcamelContext - the camel context
public PollingConsumer createPollingConsumer()
throws Exception
EndpointPollingConsumer.receive(),
PollingConsumer.receiveNoWait() or
PollingConsumer.receive(long) whenever it is ready to do so
rather than using the Event
Based Consumer returned by Endpoint.createConsumer(Processor)
createPollingConsumer in interface EndpointException - if the pull consumer could not be createdpublic Exchange createExchange(Exchange exchange)
Endpoint
createExchange in interface Endpointexchange - given exchange to use for pre-populate
public Class<Exchange> getExchangeType()
public Exchange createExchange()
Endpoint
createExchange in interface Endpointpublic Exchange createExchange(ExchangePattern pattern)
EndpointExchangePattern such as whether its going
to be an ExchangePattern.InOnly or ExchangePattern.InOut exchange
createExchange in interface Endpointpattern - the message exchange pattern for the exchange
public ExchangePattern getExchangePattern()
setExchangePattern(ExchangePattern exchangePattern)public void setExchangePattern(ExchangePattern exchangePattern)
createExchange().
The default value is ExchangePattern.InOnly
public boolean isSynchronous()
setSynchronous(boolean synchronous)public void setSynchronous(boolean synchronous)
synchronous - true to enforce synchronous processingpublic void configureProperties(Map<String,Object> options)
Endpoint
configureProperties in interface Endpointoptions - the options (properties)protected String createEndpointUri()
public void setEndpointUriIfNotSpecified(String value)
protected void setEndpointUri(String endpointUri)
public boolean isLenientProperties()
Endpoint
isLenientProperties in interface Endpoint
protected void doStart()
throws Exception
doStart in class ServiceSupportException
protected void doStop()
throws Exception
doStop in class ServiceSupportExceptionpublic static String sanitizeUri(String uri)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||