You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Daniel Kulp (Updated) (JIRA)" <ji...@apache.org> on 2011/11/14 20:18:52 UTC

[jira] [Updated] (CAMEL-4541) Bean Binding should support interface methods for non-public classes

     [ https://issues.apache.org/jira/browse/CAMEL-4541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CAMEL-4541:
-------------------------------

    Fix Version/s: 2.8.3
    
> Bean Binding should support interface methods for non-public classes
> --------------------------------------------------------------------
>
>                 Key: CAMEL-4541
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4541
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Mathieu Lalonde
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.8.3, 2.9.0
>
>         Attachments: CAMEL-4541.tar
>
>
> As a user, I'd like to be able to use bean binding for non public classes.
> Bean binding is a strong selling point for Camel so it would be nice to have it work for non-public classes as well, provided that the target method is available via an implemented interface.
> eg.
> {code}
> // return private implementation of FooInterface
> FooInterface foo = Foos.newInstance();
> // works fine with plain java
> foo.doStuff("Hello");
> ...
> // This will throw an exception at runtime stating that the method can't be invoked (Illegal Access)
> from("direct:start").bean(foo, "doStuff").mock("direct:result");
> {code}
> The Bean component should at the very least prefer interface methods (which won't cause the above exception) to class methods when a matching method is available on both the class and its interfaces (it currently ignore interface methods).
> On a side note, its probably faster to look for interface methods first since there are usually less of them.
> I'll attach a unit test and patch soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira