Interface VariableAware

All Known Subinterfaces:
BrowsableVariableRepository, Exchange, PooledExchange, VariableRepository

public interface VariableAware
Implemented by objects that carry a variables store.

Variables are a key-value namespace on the Exchange (separate from message headers and exchange properties) introduced in Camel 4.4. This interface is the read/write contract for that store and is used internally by the framework and by EIP implementations that need to get or set variables programmatically.

Since:
4.4
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Object
    Returns a variable by name.
    void
    setVariable(String name, Object value)
    Sets a variable
  • Method Details

    • getVariable

      @Nullable Object getVariable(String name)
      Returns a variable by name. If the variable is of type StreamCache then the repository should ensure to reset the stream cache before returning the value, to ensure the content can be read by the Camel end user and would be re-readable next time.
      Parameters:
      name - the name of the variable
      Returns:
      the value of the given variable or null if there is no variable for the given name
    • setVariable

      void setVariable(String name, Object value)
      Sets a variable
      Parameters:
      name - of the variable
      value - the value of the variable