Class DefaultExchange

  • All Implemented Interfaces:
    org.apache.camel.Exchange, org.apache.camel.ExtendedExchange

    public final class DefaultExchange
    extends Object
    The default and only implementation of Exchange.
    • Constructor Detail

      • DefaultExchange

        public DefaultExchange​(org.apache.camel.CamelContext context)
      • DefaultExchange

        public DefaultExchange​(org.apache.camel.CamelContext context,
                               org.apache.camel.ExchangePattern pattern)
      • DefaultExchange

        public DefaultExchange​(org.apache.camel.Exchange parent)
      • DefaultExchange

        public DefaultExchange​(org.apache.camel.Endpoint fromEndpoint)
      • DefaultExchange

        public DefaultExchange​(org.apache.camel.Endpoint fromEndpoint,
                               org.apache.camel.ExchangePattern pattern)
    • Method Detail

      • getCreated

        public long getCreated()
        Specified by:
        getCreated in interface org.apache.camel.Exchange
      • copy

        public org.apache.camel.Exchange copy()
        Specified by:
        copy in interface org.apache.camel.Exchange
      • getContext

        public org.apache.camel.CamelContext getContext()
        Specified by:
        getContext in interface org.apache.camel.Exchange
      • getProperty

        public Object getProperty​(org.apache.camel.ExchangePropertyKey key)
        Specified by:
        getProperty in interface org.apache.camel.Exchange
      • getProperty

        public <T> T getProperty​(org.apache.camel.ExchangePropertyKey key,
                                 Class<T> type)
        Specified by:
        getProperty in interface org.apache.camel.Exchange
      • getProperty

        public <T> T getProperty​(org.apache.camel.ExchangePropertyKey key,
                                 Object defaultValue,
                                 Class<T> type)
        Specified by:
        getProperty in interface org.apache.camel.Exchange
      • setProperty

        public void setProperty​(org.apache.camel.ExchangePropertyKey key,
                                Object value)
        Specified by:
        setProperty in interface org.apache.camel.Exchange
      • removeProperty

        public Object removeProperty​(org.apache.camel.ExchangePropertyKey key)
        Specified by:
        removeProperty in interface org.apache.camel.Exchange
      • getProperty

        public Object getProperty​(String name)
        Specified by:
        getProperty in interface org.apache.camel.Exchange
      • getProperty

        public Object getProperty​(String name,
                                  Object defaultValue)
        Specified by:
        getProperty in interface org.apache.camel.Exchange
      • getProperty

        public <T> T getProperty​(String name,
                                 Class<T> type)
        Specified by:
        getProperty in interface org.apache.camel.Exchange
      • getProperty

        public <T> T getProperty​(String name,
                                 Object defaultValue,
                                 Class<T> type)
        Specified by:
        getProperty in interface org.apache.camel.Exchange
      • setProperty

        public void setProperty​(String name,
                                Object value)
        Specified by:
        setProperty in interface org.apache.camel.Exchange
      • setProperties

        public void setProperties​(Map<String,​Object> properties)
        Specified by:
        setProperties in interface org.apache.camel.ExtendedExchange
      • removeProperty

        public Object removeProperty​(String name)
        Specified by:
        removeProperty in interface org.apache.camel.Exchange
      • removeProperties

        public boolean removeProperties​(String pattern)
        Specified by:
        removeProperties in interface org.apache.camel.Exchange
      • removeProperties

        public boolean removeProperties​(String pattern,
                                        String... excludePatterns)
        Specified by:
        removeProperties in interface org.apache.camel.Exchange
      • getProperties

        public Map<String,​Object> getProperties()
        Specified by:
        getProperties in interface org.apache.camel.Exchange
      • getAllProperties

        public Map<String,​Object> getAllProperties()
        Specified by:
        getAllProperties in interface org.apache.camel.Exchange
      • hasProperties

        public boolean hasProperties()
        Specified by:
        hasProperties in interface org.apache.camel.Exchange
      • getIn

        public org.apache.camel.Message getIn()
        Specified by:
        getIn in interface org.apache.camel.Exchange
      • getIn

        public <T> T getIn​(Class<T> type)
        Specified by:
        getIn in interface org.apache.camel.Exchange
      • getInOrNull

        public <T> T getInOrNull​(Class<T> type)
        Specified by:
        getInOrNull in interface org.apache.camel.ExtendedExchange
      • setIn

        public void setIn​(org.apache.camel.Message in)
        Specified by:
        setIn in interface org.apache.camel.Exchange
      • getOut

        public org.apache.camel.Message getOut()
        Specified by:
        getOut in interface org.apache.camel.Exchange
      • getOut

        public <T> T getOut​(Class<T> type)
        Specified by:
        getOut in interface org.apache.camel.Exchange
      • hasOut

        public boolean hasOut()
        Specified by:
        hasOut in interface org.apache.camel.Exchange
      • setOut

        public void setOut​(org.apache.camel.Message out)
        Specified by:
        setOut in interface org.apache.camel.Exchange
      • getMessage

        public org.apache.camel.Message getMessage()
        Specified by:
        getMessage in interface org.apache.camel.Exchange
      • getMessage

        public <T> T getMessage​(Class<T> type)
        Specified by:
        getMessage in interface org.apache.camel.Exchange
      • setMessage

        public void setMessage​(org.apache.camel.Message message)
        Specified by:
        setMessage in interface org.apache.camel.Exchange
      • getException

        public Exception getException()
        Specified by:
        getException in interface org.apache.camel.Exchange
      • getException

        public <T> T getException​(Class<T> type)
        Specified by:
        getException in interface org.apache.camel.Exchange
      • setException

        public void setException​(Throwable t)
        Specified by:
        setException in interface org.apache.camel.Exchange
      • adapt

        public <T extends org.apache.camel.Exchange> T adapt​(Class<T> type)
        Specified by:
        adapt in interface org.apache.camel.Exchange
      • getPattern

        public org.apache.camel.ExchangePattern getPattern()
        Specified by:
        getPattern in interface org.apache.camel.Exchange
      • setPattern

        public void setPattern​(org.apache.camel.ExchangePattern pattern)
        Specified by:
        setPattern in interface org.apache.camel.Exchange
      • getFromEndpoint

        public org.apache.camel.Endpoint getFromEndpoint()
        Specified by:
        getFromEndpoint in interface org.apache.camel.Exchange
      • setFromEndpoint

        public void setFromEndpoint​(org.apache.camel.Endpoint fromEndpoint)
        Specified by:
        setFromEndpoint in interface org.apache.camel.ExtendedExchange
      • getFromRouteId

        public String getFromRouteId()
        Specified by:
        getFromRouteId in interface org.apache.camel.Exchange
      • setFromRouteId

        public void setFromRouteId​(String fromRouteId)
        Specified by:
        setFromRouteId in interface org.apache.camel.ExtendedExchange
      • getExchangeId

        public String getExchangeId()
        Specified by:
        getExchangeId in interface org.apache.camel.Exchange
      • setExchangeId

        public void setExchangeId​(String id)
        Specified by:
        setExchangeId in interface org.apache.camel.Exchange
      • isFailed

        public boolean isFailed()
        Specified by:
        isFailed in interface org.apache.camel.Exchange
      • isTransacted

        public boolean isTransacted()
        Specified by:
        isTransacted in interface org.apache.camel.Exchange
      • setTransacted

        public void setTransacted​(boolean transacted)
        Specified by:
        setTransacted in interface org.apache.camel.ExtendedExchange
      • isRouteStop

        public boolean isRouteStop()
        Specified by:
        isRouteStop in interface org.apache.camel.Exchange
      • setRouteStop

        public void setRouteStop​(boolean routeStop)
        Specified by:
        setRouteStop in interface org.apache.camel.Exchange
      • isExternalRedelivered

        public boolean isExternalRedelivered()
        Specified by:
        isExternalRedelivered in interface org.apache.camel.Exchange
      • isRollbackOnly

        public boolean isRollbackOnly()
        Specified by:
        isRollbackOnly in interface org.apache.camel.Exchange
      • setRollbackOnly

        public void setRollbackOnly​(boolean rollbackOnly)
        Specified by:
        setRollbackOnly in interface org.apache.camel.Exchange
      • isRollbackOnlyLast

        public boolean isRollbackOnlyLast()
        Specified by:
        isRollbackOnlyLast in interface org.apache.camel.Exchange
      • setRollbackOnlyLast

        public void setRollbackOnlyLast​(boolean rollbackOnlyLast)
        Specified by:
        setRollbackOnlyLast in interface org.apache.camel.Exchange
      • getUnitOfWork

        public org.apache.camel.spi.UnitOfWork getUnitOfWork()
        Specified by:
        getUnitOfWork in interface org.apache.camel.Exchange
      • setUnitOfWork

        public void setUnitOfWork​(org.apache.camel.spi.UnitOfWork unitOfWork)
        Specified by:
        setUnitOfWork in interface org.apache.camel.ExtendedExchange
      • addOnCompletion

        public void addOnCompletion​(org.apache.camel.spi.Synchronization onCompletion)
        Specified by:
        addOnCompletion in interface org.apache.camel.ExtendedExchange
      • containsOnCompletion

        public boolean containsOnCompletion​(org.apache.camel.spi.Synchronization onCompletion)
        Specified by:
        containsOnCompletion in interface org.apache.camel.ExtendedExchange
      • handoverCompletions

        public void handoverCompletions​(org.apache.camel.Exchange target)
        Specified by:
        handoverCompletions in interface org.apache.camel.ExtendedExchange
      • handoverCompletions

        public List<org.apache.camel.spi.Synchronization> handoverCompletions()
        Specified by:
        handoverCompletions in interface org.apache.camel.ExtendedExchange
      • getHistoryNodeId

        public String getHistoryNodeId()
        Specified by:
        getHistoryNodeId in interface org.apache.camel.ExtendedExchange
      • setHistoryNodeId

        public void setHistoryNodeId​(String historyNodeId)
        Specified by:
        setHistoryNodeId in interface org.apache.camel.ExtendedExchange
      • getHistoryNodeLabel

        public String getHistoryNodeLabel()
        Specified by:
        getHistoryNodeLabel in interface org.apache.camel.ExtendedExchange
      • setHistoryNodeLabel

        public void setHistoryNodeLabel​(String historyNodeLabel)
        Specified by:
        setHistoryNodeLabel in interface org.apache.camel.ExtendedExchange
      • getHistoryNodeSource

        public String getHistoryNodeSource()
        Specified by:
        getHistoryNodeSource in interface org.apache.camel.ExtendedExchange
      • setHistoryNodeSource

        public void setHistoryNodeSource​(String historyNodeSource)
        Specified by:
        setHistoryNodeSource in interface org.apache.camel.ExtendedExchange
      • isNotifyEvent

        public boolean isNotifyEvent()
        Specified by:
        isNotifyEvent in interface org.apache.camel.ExtendedExchange
      • setNotifyEvent

        public void setNotifyEvent​(boolean notifyEvent)
        Specified by:
        setNotifyEvent in interface org.apache.camel.ExtendedExchange
      • isInterrupted

        public boolean isInterrupted()
        Specified by:
        isInterrupted in interface org.apache.camel.ExtendedExchange
      • setInterrupted

        public void setInterrupted​(boolean interrupted)
        Specified by:
        setInterrupted in interface org.apache.camel.ExtendedExchange
      • setInterruptable

        public void setInterruptable​(boolean interruptable)
        Specified by:
        setInterruptable in interface org.apache.camel.ExtendedExchange
      • isRedeliveryExhausted

        public boolean isRedeliveryExhausted()
        Specified by:
        isRedeliveryExhausted in interface org.apache.camel.ExtendedExchange
      • setRedeliveryExhausted

        public void setRedeliveryExhausted​(boolean redeliveryExhausted)
        Specified by:
        setRedeliveryExhausted in interface org.apache.camel.ExtendedExchange
      • getErrorHandlerHandled

        public Boolean getErrorHandlerHandled()
        Specified by:
        getErrorHandlerHandled in interface org.apache.camel.ExtendedExchange
      • isErrorHandlerHandledSet

        public boolean isErrorHandlerHandledSet()
        Specified by:
        isErrorHandlerHandledSet in interface org.apache.camel.ExtendedExchange
      • isErrorHandlerHandled

        public boolean isErrorHandlerHandled()
        Specified by:
        isErrorHandlerHandled in interface org.apache.camel.ExtendedExchange
      • setErrorHandlerHandled

        public void setErrorHandlerHandled​(Boolean errorHandlerHandled)
        Specified by:
        setErrorHandlerHandled in interface org.apache.camel.ExtendedExchange
      • isStreamCacheDisabled

        public boolean isStreamCacheDisabled()
        Specified by:
        isStreamCacheDisabled in interface org.apache.camel.ExtendedExchange
      • setStreamCacheDisabled

        public void setStreamCacheDisabled​(boolean streamCacheDisabled)
        Specified by:
        setStreamCacheDisabled in interface org.apache.camel.ExtendedExchange
      • configureMessage

        protected void configureMessage​(org.apache.camel.Message message)
        Configures the message after it has been set on the exchange
      • copyInternalProperties

        public void copyInternalProperties​(org.apache.camel.Exchange target)
        Specified by:
        copyInternalProperties in interface org.apache.camel.ExtendedExchange
      • getInternalProperties

        public Map<String,​Object> getInternalProperties()
        Specified by:
        getInternalProperties in interface org.apache.camel.ExtendedExchange
      • getDefaultConsumerCallback

        public org.apache.camel.AsyncCallback getDefaultConsumerCallback()
        Specified by:
        getDefaultConsumerCallback in interface org.apache.camel.ExtendedExchange
      • setDefaultConsumerCallback

        public void setDefaultConsumerCallback​(org.apache.camel.AsyncCallback defaultConsumerCallback)
        Specified by:
        setDefaultConsumerCallback in interface org.apache.camel.ExtendedExchange
      • createExchangeId

        protected String createExchangeId()
      • setSafeCopyProperty

        public void setSafeCopyProperty​(String key,
                                        org.apache.camel.SafeCopyProperty value)
        Specified by:
        setSafeCopyProperty in interface org.apache.camel.ExtendedExchange
      • getSafeCopyProperty

        public <T> T getSafeCopyProperty​(String key,
                                         Class<T> type)
        Specified by:
        getSafeCopyProperty in interface org.apache.camel.ExtendedExchange