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

All Known Implementing Classes:
DefaultEndpoint, DirectEndpoint, FileEndpoint, JMXEndpoint, 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: 563607 $
See Also:
Exchange, Message

Method Summary
 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
 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 getContext()
          Returns the context which created the endpoint
 String getEndpointUri()
          Returns the string representation of the endpoint URI
 boolean isSingleton()
          Returns if the endpoint should be a CamelContext singleton.
 E toExchangeType(Exchange exchange)
          Converts the given exchange to this endpoints required type
 

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(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


toExchangeType

E toExchangeType(Exchange exchange)
Converts the given exchange to this endpoints required type


getContext

CamelContext getContext()
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


Copyright © 2007 Apache Software Foundation. All Rights Reserved.