org.apache.camel.impl
Class ProcessorEndpoint

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultEndpoint
          extended by org.apache.camel.impl.ScheduledPollEndpoint
              extended by org.apache.camel.impl.DefaultPollingEndpoint
                  extended by org.apache.camel.impl.ProcessorEndpoint
All Implemented Interfaces:
CamelContextAware, Endpoint, IsSingleton, Service, ShutdownableService, HasId, StatefulService, SuspendableService
Direct Known Subclasses:
BeanEndpoint, LogEndpoint, ResourceEndpoint, XsltEndpoint

public class ProcessorEndpoint
extends DefaultPollingEndpoint

An endpoint which allows exchanges to be sent into it which just invokes a given Processor. This component does not support the use of consumers.


Implementors beware that this endpoint creates producers and consumers which doesn't allow you full control of its lifecycle as a Service or SuspendableService would do. If your producers/consumers need more control of its lifecycle its adviced instead to extend DefaultEndpoint, DefaultProducer and DefaultConsumer.

Version:

Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
protected ProcessorEndpoint()
           
  ProcessorEndpoint(String endpointUri, CamelContext context, Processor processor)
           
protected ProcessorEndpoint(String endpointUri, Component component)
           
  ProcessorEndpoint(String endpointUri, Component component, Processor processor)
           
  ProcessorEndpoint(String endpointUri, Processor processor)
          Deprecated. 
 
Method Summary
 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)
protected  Processor createProcessor()
           
 Producer createProducer()
          Creates a new producer which is used send messages into the endpoint
 Processor getProcessor()
           
 boolean isSingleton()
          Whether this class supports being singleton or not.
protected  void onExchange(Exchange exchange)
           
 void setProcessor(Processor processor)
           
 
Methods inherited from class org.apache.camel.impl.DefaultPollingEndpoint
createConsumer
 
Methods inherited from class org.apache.camel.impl.ScheduledPollEndpoint
configureProperties
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureConsumer, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, doStart, doStop, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, hashCode, isLenientProperties, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setSynchronous, toString
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

ProcessorEndpoint

protected ProcessorEndpoint()

ProcessorEndpoint

public ProcessorEndpoint(String endpointUri,
                         CamelContext context,
                         Processor processor)

ProcessorEndpoint

public ProcessorEndpoint(String endpointUri,
                         Component component,
                         Processor processor)

ProcessorEndpoint

protected ProcessorEndpoint(String endpointUri,
                            Component component)

ProcessorEndpoint

@Deprecated
public ProcessorEndpoint(String endpointUri,
                                    Processor processor)
Deprecated. 

Method Detail

createProducer

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

Returns:
a newly created producer
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
Overrides:
createPollingConsumer in class DefaultEndpoint
Returns:
a newly created pull consumer
Throws:
Exception - if the pull consumer could not be created

getProcessor

public Processor getProcessor()
                       throws Exception
Throws:
Exception

setProcessor

public void setProcessor(Processor processor)

createProcessor

protected Processor createProcessor()
                             throws Exception
Throws:
Exception

onExchange

protected void onExchange(Exchange exchange)
                   throws Exception
Throws:
Exception

isSingleton

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

Returns:
true to be a single shared instance, false to create new instances.


Apache CAMEL