Package org.apache.camel
Interface ComponentAware
-
public interface ComponentAwareAn interface to represent an object which wishes to be injected with aComponent.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ComponentgetComponent()Get theComponentdefault <T extends Component>
TgetComponent(Class<T> type)Get theComponentas the specified type.voidsetComponent(Component component)Injects theComponent
-
-
-
Method Detail
-
setComponent
void setComponent(Component component)
Injects theComponent- Parameters:
component- the component
-
getComponent
default <T extends Component> T getComponent(Class<T> type)
Get theComponentas the specified type.- Parameters:
type- the proprietary class or interface of the underlying concrete Component.- Returns:
- an instance of the underlying concrete Component as the required type.
- Throws:
IllegalArgumentException- if the component class can't be cast to required type,
-
-