org.apache.camel
Interface Endpoint<E extends Exchange>

All Known Subinterfaces:
BrowsableEndpoint<T>
All Known Implementing Classes:
BeanEndpoint, DataSetEndpoint, DefaultEndpoint, DefaultPollingEndpoint, DirectEndpoint, FileEndpoint, JMXEndpoint, ListEndpoint, MockEndpoint, ProcessorEndpoint, ScheduledPollEndpoint, SedaEndpoint, TimerEndpoint

public interface Endpoint<E extends Exchange>

An endpoint implements the Message Endpoint pattern and represents an endpoint that can send and receive message exchanges

Version:
$Revision: 684667 $
See Also:
Exchange, Message

Method Summary
 void configureProperties(Map options)
           
 Consumer<E> createConsumer(Processor processor)
          Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor
 E createExchange()
          Create a new exchange for communicating with this endpoint
 E 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
 E 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<E> 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 createConsumer(Processor)
 Producer<E> createProducer()
          Creates a new producer which is used send messages into the endpoint
 CamelContext getCamelContext()
          Returns the context which created the endpoint
 CamelContext getContext()
          Deprecated. 
 String getEndpointUri()
          Returns the string representation of the endpoint URI
 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 lenient = true means that the endpoint allows additional unknown options to be passed to it but does not throw a ResolveEndpointFailedException when creating the endpoint.

 boolean isSingleton()
          Returns if the endpoint should be a CamelContext singleton.
 void setCamelContext(CamelContext context)
           
 void setContext(CamelContext context)
          Deprecated. 
 

Method Detail

isSingleton

boolean isSingleton()
Returns if the endpoint should be a CamelContext singleton. If the endpoint is a Singleton, then a single Endpoint instance will be shared by all routes with the same URI. Because the endpoint is shared, it should be treated as an immutable.


getEndpointUri

String getEndpointUri()
Returns the string representation of the endpoint URI


createExchange

E createExchange()
Create a new exchange for communicating with this endpoint


createExchange

E 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

Parameters:
pattern - the message exchange pattern for the exchange

createExchange

E 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


getCamelContext

CamelContext getCamelContext()
Returns the context which created the endpoint

Returns:
the context which created the endpoint

createProducer

Producer<E> createProducer()
                                            throws Exception
Creates a new producer which is used send messages into the endpoint

Returns:
a newly created producer
Throws:
Exception

createConsumer

Consumer<E> createConsumer(Processor processor)
                                            throws Exception
Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor

Returns:
a newly created consumer
Throws:
Exception

createPollingConsumer

PollingConsumer<E> createPollingConsumer()
                                                          throws Exception
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 createConsumer(Processor)

Returns:
a newly created pull consumer
Throws:
Exception - if the pull consumer could not be created

configureProperties

void configureProperties(Map options)

setCamelContext

void setCamelContext(CamelContext context)

getContext

@Deprecated
CamelContext getContext()
Deprecated. 


setContext

@Deprecated
void setContext(CamelContext context)
Deprecated. 


isLenientProperties

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 lenient = true means that the endpoint allows additional unknown options to be passed to it but does not throw a ResolveEndpointFailedException when creating the endpoint.

This options is used by a few components for instance the HTTP based that can have dynamic URI options appended that is targeted for an external system.

Most endpoints is configued to be not lenient.



Apache CAMEL