You can use any kind of IoC to inject beans from the XML file in your Java code. For example Spring have a number of annotations. Or you can use the @Resource annotation from JDK1.6.
Something like this in the Java DSL class
@Resource(name = "myTransform") private MyTransform myTransform
You may need a getter/setter pair for it so the @Resource works. Can't remember if it can IoC without the setter.
Doesnt look like that works. I get null for myTransform, even with getter/setter. It looks like the way the beans.xml in camel-osgi is configured, the DSL will get started first and the dependency injection never gets established for that attribute. Am I missing something? Thanks!
What version of Fuse ESB / or Camel are you using?
And are you running the application in Fuse ESB or what other server?