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

Dmitry Buzdin commented on CAMEL-3228:
--------------------------------------

Something like the following should do the thing.

{code}
        CamelToDozerAdapter adapter = new CamelToDozerAdapter(camelContext);
        BeanContainer.getInstance().setClassLoader(adapter);
{code}

{code}
    private static class CamelToDozerAdapter implements DozerClassLoader {

        private final ClassResolver classResolver;

        private CamelToDozerAdapter(CamelContext camelContext) {
            classResolver = camelContext.getClassResolver();
        }

        public Class<?> loadClass(String s) {
            return classResolver.resolveClass(s);
        }

        public URL loadResource(String s) {
            return classResolver.loadResourceAsURL(s);
        }
    }
{code}

I am now looking for the best place to add this code. The trick it to overwrite 
the behavior early so Dozer loads all resources using that.

> Dozer should support OSGi and work with Apache Camel
> ----------------------------------------------------
>
>                 Key: CAMEL-3228
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3228
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Konstantin Buzdin
>            Assignee: Willem Jiang
>             Fix For: 2.7.0
>
>         Attachments: CAMEL-3228_-_Upgrade_to_Dozer_5_3_0_.patch, 
> dozer-osgi-5.3.0.jar, pom.xml
>
>
> Dozer 5.3.0 has been released. It has changes in internal API, which make 
> usage of dozer-camel impossible with the most recent version.
> As Dozer maintainer I could contribute a patch upgrading camel-dozer module 
> to use 5.3.0. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to