Interface ProcessorExchangeFactory

All Superinterfaces:
AutoCloseable, CamelContextAware, HasCamelContext, HasId, IdAware, NonManagedService, PooledObjectFactory<Exchange>, RouteIdAware, Service

public interface ProcessorExchangeFactory extends PooledObjectFactory<Exchange>, NonManagedService, RouteIdAware, IdAware
Factory used by Processor (EIPs) when they create copies of the processed Exchange.

Some EIPs like WireTap, Multicast, Split etc creates copies of the processed exchange which they use as sub exchanges. This factory allows to use exchange pooling. The factory is pluggable which allows to use different strategies. The default factory will create a new Exchange instance, and the pooled factory will pool and reuse exchanges.

See Also:
  • Field Details

  • Method Details

    • getProcessor

      Processor getProcessor()
      The processor using this factory.
    • newProcessorExchangeFactory

      ProcessorExchangeFactory newProcessorExchangeFactory(Processor processor)
      Creates a new ProcessorExchangeFactory that is private for the given consumer.
      Parameters:
      processor - the processor that will use the created ProcessorExchangeFactory
      Returns:
      the created factory.
    • createCopy

      Exchange createCopy(Exchange exchange)
      Gets a copy of the given Exchange
      Parameters:
      exchange - original exchange
    • createCorrelatedCopy

      Exchange createCorrelatedCopy(Exchange exchange, boolean handover)
      Gets a copy of the given Exchange and the copy is correlated to the source
      Parameters:
      exchange - original exchange
      handover - whether the on completion callbacks should be handed over to the new copy.
    • create

      Exchange create(Endpoint fromEndpoint, ExchangePattern exchangePattern)
      Gets a new Exchange
    • release

      boolean release(Exchange exchange)
      Releases the exchange back into the pool
      Specified by:
      release in interface PooledObjectFactory<Exchange>
      Parameters:
      exchange - the exchange
      Returns:
      true if released into the pool, or false if something went wrong and the exchange was discarded