|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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()
|
protected |
DefaultEndpoint(String endpointUri)
|
protected |
DefaultEndpoint(String endpointUri,
CamelContext camelContext)
|
protected |
DefaultEndpoint(String endpointUri,
Component component)
|
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) |
boolean |
equals(Object object)
|
CamelContext |
getCamelContext()
Returns the context which created the endpoint |
Component |
getComponent()
|
String |
getEndpointKey()
Returns a string key of this endpoint. |
String |
getEndpointUri()
Returns the string representation of the endpoint URI |
ExchangePattern |
getExchangePattern()
|
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()
|
static String |
sanitizeUri(String uri)
|
void |
setCamelContext(CamelContext camelContext)
Sets the camel context. |
protected void |
setEndpointUri(String endpointUri)
|
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)
|
void |
setSynchronous(boolean synchronous)
Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). |
void |
start()
Starts the service |
void |
stop()
Stops the service |
String |
toString()
|
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 |
Constructor Detail |
---|
protected DefaultEndpoint(String endpointUri, Component component)
protected DefaultEndpoint(String endpointUri, CamelContext camelContext)
protected DefaultEndpoint(String endpointUri)
protected DefaultEndpoint()
Method Detail |
---|
public int hashCode()
hashCode
in class Object
public boolean equals(Object object)
equals
in class Object
public String toString()
toString
in class Object
public String getId()
getId
in interface HasId
public String getEndpointUri()
Endpoint
getEndpointUri
in interface Endpoint
public String getEndpointKey()
Endpoint
LifecycleStrategy
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 Endpoint
public CamelContext getCamelContext()
Endpoint
getCamelContext
in interface CamelContextAware
getCamelContext
in interface Endpoint
public Component getComponent()
public void setCamelContext(CamelContext camelContext)
Endpoint
setCamelContext
in interface CamelContextAware
setCamelContext
in interface Endpoint
camelContext
- the camel contextpublic PollingConsumer createPollingConsumer() throws Exception
Endpoint
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)
createPollingConsumer
in interface Endpoint
Exception
- if the pull consumer could not be createdpublic Exchange createExchange(Exchange exchange)
Endpoint
createExchange
in interface Endpoint
exchange
- given exchange to use for pre-populate
public Class<Exchange> getExchangeType()
public Exchange createExchange()
Endpoint
createExchange
in interface Endpoint
public Exchange createExchange(ExchangePattern pattern)
Endpoint
ExchangePattern
such as whether its going
to be an ExchangePattern.InOnly
or ExchangePattern.InOut
exchange
createExchange
in interface Endpoint
pattern
- the message exchange pattern for the exchange
public ExchangePattern getExchangePattern()
public void setExchangePattern(ExchangePattern exchangePattern)
public boolean isSynchronous()
public void setSynchronous(boolean synchronous)
synchronous
- true to enforce synchronous processingpublic void configureProperties(Map<String,Object> options)
Endpoint
configureProperties
in interface Endpoint
options
- the options (properties)protected String createEndpointUri()
public void setEndpointUriIfNotSpecified(String value)
protected void setEndpointUri(String endpointUri)
public boolean isLenientProperties()
Endpoint
isLenientProperties
in interface Endpoint
public void start() throws Exception
Service
start
in interface Service
Exception
- is thrown if starting failedpublic void stop() throws Exception
Service
stop
in interface Service
Exception
- is thrown if stopping failedpublic static String sanitizeUri(String uri)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |