Package org.apache.camel
Interface ComponentAware
- All Known Subinterfaces:
ApiEndpoint
,AsyncEndpoint
,BrowsableEndpoint
,DelegateEndpoint
,Endpoint
,InterceptSendToEndpoint
public interface ComponentAware
An interface to represent an object which wishes to be injected with a
Component
.-
Method Summary
Modifier and TypeMethodDescriptionGet theComponent
default <T extends Component>
TgetComponent
(Class<T> type) Get theComponent
as the specified type.void
setComponent
(Component component) Injects theComponent
-
Method Details
-
setComponent
Injects theComponent
- Parameters:
component
- the component
-
getComponent
Component getComponent()Get theComponent
- Returns:
- the component
-
getComponent
Get theComponent
as 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,
-