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 TypeMethodDescription@Nullable ObjectgetVariable(String name) Returns a variable by name.voidsetVariable(String name, Object value) Sets a variable
-
Method Details
-
getVariable
Returns a variable by name. If the variable is of typeStreamCachethen 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
-