[jira] [Commented] (CXF-7922) Unable to invoke default interface methods in proxy-based clients

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (CXF-7922) Unable to invoke default interface methods in proxy-based clients

JIRA jira@apache.org

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

ASF GitHub Bot commented on CXF-7922:
-------------------------------------

andymc12 opened a new pull request #480: [CXF-7922] Invoke default interface methods on client interfaces
URL: https://github.com/apache/cxf/pull/480
 
 
   Runtime code changes based on patterns described here:
   https://rmannibucau.wordpress.com/2014/03/27/java-8-default-interface-methods-and-jdk-dynamic-proxies/
   
   This enables default interface methods to be invoked when they are not overridden or annotated with `@GET`-type annotations.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


> Unable to invoke default interface methods in proxy-based clients
> -----------------------------------------------------------------
>
>                 Key: CXF-7922
>                 URL: https://issues.apache.org/jira/browse/CXF-7922
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.2.7
>            Reporter: Andy McCright
>            Assignee: Andy McCright
>            Priority: Minor
>
> {{When invoking a default method on an interface used as a MicroProfile Rest Client interface (and presumably the JAX-RS proxy-based client), I see the following exception:}}
> {{javax.ws.rs.ProcessingException: Method org.apache.cxf.microprofile.client.mock.MyClient.myDefaultMethod is not a valid resource method}}
> {{ at org.apache.cxf.microprofile.client.CxfTypeSafeClientBuilderTest.testCanInvokeDefaultInterfaceMethods(CxfTypeSafeClientBuilderTest.java:172)}}
>  
> Invoking default interface methods from a dynamic proxy's InvocationHandler is outlined in this article:
> [https://rmannibucau.wordpress.com/2014/03/27/java-8-default-interface-methods-and-jdk-dynamic-proxies/]
>  
> {{This type of operation becomes critical when combining the MicroProfile Rest Client with MP Fault Tolerance annotations like this:}}
> {{public interface MyClient {}}
> {{    @GET}}
> {{    @Fallback(fallbackMethod="useFallback")}}
> {{    String tryActualRemoteRequest();}}
> {{}}{{    default String useFallback() {}}
> {{        return "useful default value";}}
> {{    }}}
> {{}}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)