org.apache.camel.impl
Class DefaultEndpoint<E extends Exchange>

java.lang.Object
  extended by org.apache.camel.impl.DefaultEndpoint<E>
All Implemented Interfaces:
CamelContextAware, Endpoint<E>
Direct Known Subclasses:
DirectEndpoint, JMXEndpoint, ListEndpoint, MockEndpoint, ScheduledPollEndpoint, SedaEndpoint, TimerEndpoint

public abstract class DefaultEndpoint<E extends Exchange>
extends Object
implements Endpoint<E>, CamelContextAware

A default endpoint useful for implementation inheritance

Version:
$Revision: 41314 $

Constructor Summary
protected DefaultEndpoint(String endpointUri)
           
protected DefaultEndpoint(String endpointUri, CamelContext camelContext)
           
protected DefaultEndpoint(String endpointUri, Component component)
           
 
Method Summary
 void configureProperties(Map options)
           
 E convertTo(Class<E> type, Exchange exchange)
          Converts the given exchange to the specified exchange type
 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
protected  ScheduledThreadPoolExecutor createExecutorService()
           
 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 Endpoint.createConsumer(Processor)
 boolean equals(Object object)
           
 CamelContext getCamelContext()
          Returns the context which created the endpoint
 Component getComponent()
           
 String getEndpointUri()
          Returns the string representation of the endpoint URI
 ExchangePattern getExchangePattern()
           
 Class<E> getExchangeType()
          Returns the type of the exchange which is generated by this component
 ScheduledExecutorService getExecutorService()
           
 int hashCode()
           
 void setCamelContext(CamelContext camelContext)
          Injects the CamelContext
 void setExchangePattern(ExchangePattern exchangePattern)
           
 void setExecutorService(ScheduledExecutorService executorService)
           
 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, isSingleton
 

Constructor Detail

DefaultEndpoint

protected DefaultEndpoint(String endpointUri,
                          Component component)

DefaultEndpoint

protected DefaultEndpoint(String endpointUri,
                          CamelContext camelContext)

DefaultEndpoint

protected DefaultEndpoint(String endpointUri)
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

getEndpointUri

public String getEndpointUri()
Description copied from interface: Endpoint
Returns the string representation of the endpoint URI

Specified by:
getEndpointUri in interface Endpoint<E extends Exchange>

getCamelContext

public CamelContext getCamelContext()
Description copied from interface: Endpoint
Returns the context which created the endpoint

Specified by:
getCamelContext in interface Endpoint<E extends Exchange>
Returns:
the context which created the endpoint

getComponent

public Component getComponent()

setCamelContext

public void setCamelContext(CamelContext camelContext)
Description copied from interface: CamelContextAware
Injects the CamelContext

Specified by:
setCamelContext in interface CamelContextAware
Specified by:
setCamelContext in interface Endpoint<E extends Exchange>

getExecutorService

public ScheduledExecutorService getExecutorService()
Returns:
the executor

setExecutorService

public void setExecutorService(ScheduledExecutorService executorService)
Parameters:
executorService - the executor to set

createPollingConsumer

public PollingConsumer<E> createPollingConsumer()
                                                          throws Exception
Description copied from interface: Endpoint
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)

Specified by:
createPollingConsumer in interface Endpoint<E extends Exchange>
Returns:
a newly created pull consumer
Throws:
Exception - if the pull consumer could not be created

convertTo

public E convertTo(Class<E> type,
                   Exchange exchange)
Converts the given exchange to the specified exchange type


createExchange

public E createExchange(Exchange exchange)
Description copied from interface: Endpoint
Creates a new exchange for communicating with this exchange using the given exchange to pre-populate the values of the headers and messages

Specified by:
createExchange in interface Endpoint<E extends Exchange>

getExchangeType

public Class<E> getExchangeType()
Returns the type of the exchange which is generated by this component


createExchange

public E createExchange()
Description copied from interface: Endpoint
Create a new exchange for communicating with this endpoint

Specified by:
createExchange in interface Endpoint<E extends Exchange>

createExchange

public E createExchange(ExchangePattern pattern)
Description copied from interface: Endpoint
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

Specified by:
createExchange in interface Endpoint<E extends Exchange>
Parameters:
pattern - the message exchange pattern for the exchange

getExchangePattern

public ExchangePattern getExchangePattern()

setExchangePattern

public void setExchangePattern(ExchangePattern exchangePattern)

createExecutorService

protected ScheduledThreadPoolExecutor createExecutorService()

configureProperties

public void configureProperties(Map options)
Specified by:
configureProperties in interface Endpoint<E extends Exchange>


Copyright © 2008 IONA Open Source Community. All Rights Reserved.