org.apache.camel.impl
Class InterceptSendToEndpoint

java.lang.Object
  extended by org.apache.camel.impl.InterceptSendToEndpoint
All Implemented Interfaces:
Endpoint, IsSingleton, Service

public class InterceptSendToEndpoint
extends Object
implements Endpoint

This is an endpoint when sending to it, is intercepted and is routed in a detour

Version:

Constructor Summary
InterceptSendToEndpoint(Endpoint destination, boolean skip)
          Intercepts sending to the given endpoint
 
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 endpoint 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)
 Producer createProducer()
          Creates a new producer which is used send messages into the endpoint
 CamelContext getCamelContext()
          Returns the context which created the endpoint
 Endpoint getDelegate()
           
 EndpointConfiguration getEndpointConfiguration()
          Returns the object representation of the endpoint configuration
 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.

 boolean isSingleton()
          Whether this class supports being singleton or not.
 void setCamelContext(CamelContext context)
          Sets the camel context.
 void setDetour(Processor detour)
           
 void start()
          Starts the service
 void stop()
          Stops the service
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InterceptSendToEndpoint

public InterceptSendToEndpoint(Endpoint destination,
                               boolean skip)
Intercepts sending to the given endpoint

Parameters:
destination - the original endpoint
skip - true to skip sending after the detour to the original endpoint
Method Detail

setDetour

public void setDetour(Processor detour)

getDelegate

public Endpoint getDelegate()

getEndpointUri

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

Specified by:
getEndpointUri in interface Endpoint
Returns:
the endpoint URI

getEndpointConfiguration

public EndpointConfiguration getEndpointConfiguration()
Description copied from interface: Endpoint
Returns the object representation of the endpoint configuration

Specified by:
getEndpointConfiguration in interface Endpoint
Returns:
the endpoint configuration

getEndpointKey

public String getEndpointKey()
Description copied from interface: Endpoint
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.

Specified by:
getEndpointKey in interface Endpoint
Returns:
the endpoint key

createExchange

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

Specified by:
createExchange in interface Endpoint
Returns:
a new exchange

createExchange

public Exchange 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
Parameters:
pattern - the message exchange pattern for the exchange
Returns:
a new exchange

createExchange

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

Specified by:
createExchange in interface Endpoint
Parameters:
exchange - given exchange to use for pre-populate
Returns:
a new exchange

getCamelContext

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

Specified by:
getCamelContext in interface Endpoint
Returns:
the context which created the endpoint

createProducer

public Producer createProducer()
                        throws Exception
Description copied from interface: Endpoint
Creates a new producer which is used send messages into the endpoint

Specified by:
createProducer in interface Endpoint
Returns:
a newly created producer
Throws:
Exception - can be thrown

createConsumer

public Consumer createConsumer(Processor processor)
                        throws Exception
Description copied from interface: Endpoint
Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor

Specified by:
createConsumer in interface Endpoint
Parameters:
processor - the given processor
Returns:
a newly created consumer
Throws:
Exception - can be thrown

createPollingConsumer

public PollingConsumer 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
Returns:
a newly created pull consumer
Throws:
Exception - if the pull consumer could not be created

configureProperties

public void configureProperties(Map<String,Object> options)
Description copied from interface: Endpoint
Configure properties on this endpoint.

Specified by:
configureProperties in interface Endpoint
Parameters:
options - the options (properties)

setCamelContext

public void setCamelContext(CamelContext context)
Description copied from interface: Endpoint
Sets the camel context.

Specified by:
setCamelContext in interface Endpoint
Parameters:
context - the camel context

isLenientProperties

public boolean isLenientProperties()
Description copied from interface: Endpoint
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.

Specified by:
isLenientProperties in interface Endpoint
Returns:
whether properties is lenient or not

isSingleton

public boolean isSingleton()
Description copied from interface: IsSingleton
Whether this class supports being singleton or not.

Specified by:
isSingleton in interface IsSingleton
Returns:
true to be a single shared instance, false to create new instances.

start

public void start()
           throws Exception
Description copied from interface: Service
Starts the service

Specified by:
start in interface Service
Throws:
Exception - is thrown if starting failed

stop

public void stop()
          throws Exception
Description copied from interface: Service
Stops the service

Specified by:
stop in interface Service
Throws:
Exception - is thrown if stopping failed

toString

public String toString()
Overrides:
toString in class Object


Apache CAMEL