org.apache.camel
Interface Endpoint

All Superinterfaces:
IsSingleton
All Known Subinterfaces:
BrowsableEndpoint
All Known Implementing Classes:
AtomEndpoint, BeanEndpoint, BrowseEndpoint, CacheEndpoint, CometdEndpoint, CxfBeanEndpoint, CxfEndpoint, CxfRsEndpoint, CxfRsSpringEndpoint, CxfSoapEndpoint, CxfSpringEndpoint, DataSetEndpoint, DefaultEndpoint, DefaultPollingEndpoint, DelimitedEndpoint, DirectEndpoint, EventEndpoint, FeedEndpoint, FileEndpoint, FixedLengthEndpoint, FreemarkerEndpoint, FtpEndpoint, FtpsEndpoint, GenericFileEndpoint, GHttpEndpoint, GMailEndpoint, GTaskEndpoint, HttpEndpoint, IBatisEndpoint, InterceptSendToEndpoint, IrcEndpoint, JavaSpaceEndpoint, JcrEndpoint, JdbcEndpoint, JettyHttpEndpoint, JmsEndpoint, JmsQueueEndpoint, JmsTemporaryQueueEndpoint, JmsTemporaryTopicEndpoint, JpaEndpoint, Jt400DataQueueEndpoint, LdapEndpoint, LogEndpoint, LuceneEndpoint, MailEndpoint, MinaEndpoint, MockEndpoint, PrinterEndpoint, ProcessorEndpoint, QuartzEndpoint, QuickfixEndpoint, RemoteFileEndpoint, ResourceBasedEndpoint, RestletEndpoint, RmiEndpoint, RssEndpoint, ScheduledPollEndpoint, SedaEndpoint, ServletEndpoint, SftpEndpoint, SmppEndpoint, SnmpEndpoint, SpringIntegrationEndpoint, SqlEndpoint, StreamEndpoint, StringTemplateEndpoint, TestEndpoint, TimerEndpoint, VelocityEndpoint, XmppEndpoint

public interface Endpoint
extends IsSingleton

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

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

Method Summary
 void configureProperties(Map<String,Object> options)
          Configure properties on this endpoint.
 Consumer createConsumer(Processor processor)
          Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor
 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 createConsumer(Processor)
 Producer createProducer()
          Creates a new producer which is used send messages into the endpoint
 CamelContext getCamelContext()
          Returns the context which created the endpoint
 String getEndpointKey()
          Returns a string key of this endpoint.
 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.

 void setCamelContext(CamelContext context)
          Sets the camel context.
 
Methods inherited from interface org.apache.camel.IsSingleton
isSingleton
 

Method Detail

getEndpointUri

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

Returns:
the endpoint URI

getEndpointKey

String getEndpointKey()
Returns a string key of this endpoint.

This key is used by 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.

Returns:
the endpoint key

createExchange

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

Returns:
a new exchange

createExchange

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

Parameters:
pattern - the message exchange pattern for the exchange
Returns:
a new exchange

createExchange

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

Parameters:
exchange - given exchange to use for pre-populate
Returns:
a new exchange

getCamelContext

CamelContext getCamelContext()
Returns the context which created the endpoint

Returns:
the context which created the endpoint

createProducer

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

Returns:
a newly created producer
Throws:
Exception - can be thrown

createConsumer

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

Parameters:
processor - the given processor
Returns:
a newly created consumer
Throws:
Exception - can be thrown

createPollingConsumer

PollingConsumer 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<String,Object> options)
Configure properties on this endpoint.

Parameters:
options - the options (properties)

setCamelContext

void setCamelContext(CamelContext context)
Sets the camel context.

Parameters:
context - the camel context

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 configured to be not lenient.

Returns:
whether properties is lenient or not


Copyright © 2007-2010 IONA Open Source Community. All Rights Reserved.