Package org.apache.camel.spi
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.
@FunctionalInterface public interface ComponentCustomizer extends Ordered
To apply custom configurations toComponent
instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ComponentCustomizer.Builder<T extends Component>
A fluent builder to create aComponentCustomizer
instance.static interface
ComponentCustomizer.Policy
Used as additional filer mechanism to control if customizers need to be applied or not.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static ComponentCustomizer.Builder<Component>
builder()
Create a genericComponentCustomizer.Builder
.static <T extends Component>
ComponentCustomizer.Builder<T>builder(Class<T> type)
Create a typedComponentCustomizer.Builder
that can process a concrete component type instance.void
configure(String name, Component target)
Customize the specifiedComponent
.static <T extends Component>
ComponentCustomizerforType(Class<T> type, org.apache.camel.util.function.ThrowingConsumer<T,Exception> consumer)
Create aComponentCustomizer
that can process a concrete component type instance.default int
getOrder()
Gets the order.default boolean
isEnabled(String name, Component target)
Checks whether this customizer should be applied to the givenComponent
.
-
-
-
Method Detail
-
builder
static ComponentCustomizer.Builder<Component> builder()
Create a genericComponentCustomizer.Builder
.- Returns:
- the
ComponentCustomizer.Builder
-
builder
static <T extends Component> ComponentCustomizer.Builder<T> builder(Class<T> type)
Create a typedComponentCustomizer.Builder
that 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 aComponentCustomizer
that can process a concrete component type instance.- Parameters:
type
- the concrete type of theComponent
consumer
- theComponent
configuration logic- Returns:
- the
ComponentCustomizer
-
configure
void configure(String name, Component target)
Customize the specifiedComponent
.- Parameters:
name
- the unique name of the componenttarget
- the component to configure
-
isEnabled
default boolean isEnabled(String name, Component target)
Checks whether this customizer should be applied to the givenComponent
.- Parameters:
name
- the unique name of the componenttarget
- the component to configure- Returns:
- true if the customizer should be applied
-
getOrder
default int getOrder()
Description copied from interface:Ordered
Gets 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_VALUE
or egOrdered.LOWEST
.
-
-