Chapter 54. Introduction to the API Component Framework
54.1. What is the API Component Framework?
Turning APIs into components
Generic URI format
schemeis the default URI scheme defined by the component;
endpoint-prefixis a short API name, which maps to one of the classes or interfaces from the wrapped Java API;
endpointmaps to a method name; and the URI options map to method argument names.
URI format for a single API class
endpoint-prefixpart of the URI becomes redundant, and you can specify the URI in the following, shorter format:
apiNameelement blank in the configuration of the API component Maven plug-in.
Reflection and metadata
maven-javadoc-plugin) and, in many cases, is already provided in a third-party library.
Method signature files
What does the framework consist of?
- A Maven archetype
camel-archetype-api-componentMaven archetype is used to generate skeleton code for the component implementation.
- A Maven plug-in
camel-api-component-maven-pluginMaven plug-in is responsible for generating the code that implements the mapping between the Java API and the endpoint URI syntax.
- Specialized base classes
- To support the programming model of the API component framework, the Apache Camel core provides a specialized API in the
org.apache.camel.util.componentpackage. Amongst other things, this API provides specialized base classes for the component, endpoint, consumer, and producer classes.