Interface ComponentCustomizer
- All Superinterfaces:
Ordered
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy for applying custom configuration to
Component instances as they are created.
Customizers are discovered from the Registry and applied to each component during bootstrap, with
isEnabled(String, Component) (and an optional ComponentCustomizer.Policy) deciding whether a given component is
customized, and Ordered controlling the order. Use the builder() /
forType(Class, ThrowingConsumer) helpers to target a concrete component type. This is the component-level
counterpart to CamelContextCustomizer.
See CamelContext auto-configuration in
the Camel user manual.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classComponentCustomizer.Builder<T extends Component>A fluent builder to create aComponentCustomizerinstance.static interfaceUsed as additional filer mechanism to control if customizers need to be applied or not. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentCustomizer.Builder<Component> builder()Create a genericComponentCustomizer.Builder.static <T extends Component>
ComponentCustomizer.Builder<T> Create a typedComponentCustomizer.Builderthat can process a concrete component type instance.voidCustomize the specifiedComponent.static <T extends Component>
ComponentCustomizerCreate aComponentCustomizerthat can process a concrete component type instance.default intgetOrder()Gets the order.default booleanChecks whether this customizer should be applied to the givenComponent.
-
Method Details
-
builder
Create a genericComponentCustomizer.Builder.- Returns:
- the
ComponentCustomizer.Builder
-
builder
Create a typedComponentCustomizer.Builderthat can process a concrete component type instance.- Parameters:
type- the concrete type of theComponent- Returns:
- the
ComponentCustomizer.Builder
-
forType
static <T extends Component> ComponentCustomizer forType(Class<T> type, org.apache.camel.util.function.ThrowingConsumer<T, Exception> consumer) Create aComponentCustomizerthat can process a concrete component type instance.- Parameters:
type- the concrete type of theComponentconsumer- theComponentconfiguration logic- Returns:
- the
ComponentCustomizer
-
configure
-
isEnabled
-
getOrder
default int getOrder()Description copied from interface:OrderedGets the order. Use low numbers for higher priority. Normally the sorting will start from 0 and move upwards. So if you want to be last then useInteger.MAX_VALUEor egOrdered.LOWEST.
-