[[Injector-Injector]]
= Injector

The
https://www.javadoc.io/doc/org.apache.camel/camel-api/current/org/apache/camel/spi/Injector.html[Injector]
is a pluggable strategy to any IoC container such as
Spring to be able to create and
dependency-inject objects of a certain type.

For example if you are using the
xref:inversion-of-control-with-smart-defaults.adoc[Inversion Of Control
With Smart Defaults] pattern to minimize your XML dependency; Camel will
automatically discover and use new endpoints when they are referenced
via their URIs by using the META-INF/services settings.
You could explicitly configure each Component and
Endpoint in your Spring XML file; or let Camel find
the defaults then use the Injector to create and inject any of its
dependencies.

As an example; consider the xref:components::jms-component.adoc[JMS] component. Rather than
explicitly configuring the JMS component in Spring XML you can just
provide a ConnectionFactory in your Spring XML which the Injector will
use to properly configure the JmsComponent when it is instantiated.
