[ 
https://issues.apache.org/jira/browse/CAMEL-6380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13670019#comment-13670019
 ] 

Aaron Whiteside edited comment on CAMEL-6380 at 5/30/13 4:17 AM:
-----------------------------------------------------------------

Do you mean Camel currently supports loading XML routing definition extensions, 
if so how?

What I propose shouldn't need a schema validator, JAXB will take care of that 
the way it does now if you supply incorrect XML. I think all the changes could 
be made in a class like ModelHelper, and update everything to use it to get the 
JAXBContext.

I've been looking at the following classes CamelNamespaceHandler, ModelHelper 
and DefaultCamelContext.loadRoutesDefinition()..

I see 11 usages of JAXBContext.newInstance() in the Camel project (and I think 
about 4-5 of those we would need to change) that should be changed to use 
ModelHelper to create the JAXBContext. Then after that we can make ModelHelper 
pickup the custom packages to use from 
META-INF/services/org/apache/camel/model/* or some such location.

                
      was (Author: aaronjwhiteside):
    Do you mean Camel currently supports loading XML routing definition 
extensions, if so how?

What I propose shouldn't need a schema validator, JAXB will take care of that 
the way it does now if you supply incorrect XML. I think all the changes could 
be made in a class like ModelHelper, and update everything to use it to get the 
JAXBContext.

I've been looking at the following classes CamelNamespaceHandler, ModelHelper 
and DefaultCamelContext.loadRoutesDefinition()..


                  
> Custom extensions to Camel's XML configuration
> ----------------------------------------------
>
>                 Key: CAMEL-6380
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6380
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.11.0
>            Reporter: Aaron Whiteside
>             Fix For: 3.0.0, Future
>
>
> Allow custom elements to be defined and used in Camel's XML configuration.
> The use case I have is that we have a fair number of Processor's that take 
> various options and we dynamically load and unload routes from external XML 
> files (not in any spring contexts). 
> Currently we do this by reimplementing Camel's loadRoutesDefinition() method, 
> and supplying additional packages when creating the JAXBContext. It would be 
> good is there were an officially supported mechanism to do this.
> We place our custom *Definitions in separate namespaces.
> I imagine it wouldn't be too hard to add support to Camel to look for a 
> specific  META-INF/services file and add the additional packages contained 
> within to the JAXBContext, when it is created.
> I guess this also means the structure of *Definition classes would need to be 
> documented to allow others to take advantage of them.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to