...
The FooComponent can then be auto-injected with resources using the Injector, such as to support Spring based auto-wiring, or to support @Resource (EJB3 style) injection or Guice style @Inject injection.
Working with Spring XML
You can configure a component via Spring using the following mechanism...
Wiki Markup |
---|
{snippet:id=example|lang=xml|url=activemq/camel/trunk/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpringTest.xml} |
Which allows you to configure a component using some name (activemq in the above example), then you can refer to the component using activemq:destinationName.
If you want to add explicit Spring 2.x XML objects to your XML then you could use the Due to the auto-discover and injection of components based on their initial use via an endpoint URI you don't have to explicitly add a <fooComponent> element to your Spring XML if you don't want to. However if you do want to then you could use xbean-spring which tries to automate most of this the XML binding work for you.If ; or you could look in camel-spring at CamelNamespaceHandler you'll see how we handle the Spring XML stuff (warning its kinda hairy code to look at . If you wanted <fooComponent> to be a standard part of the core Camel schema then you'd hack that file to add your component & conftribute a patch to the camel XSD. Otherwise you could write your own namespace & schema if you prefer.
...