brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertgmoss <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Determine type of entity in rest ...
Date Tue, 16 Jun 2015 15:43:24 GMT
Github user robertgmoss commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/690#discussion_r32534702
  
    --- Diff: usage/rest-client/src/main/java/brooklyn/rest/client/BrooklynApi.java ---
    @@ -116,22 +119,26 @@ public BrooklynApi(URL endpoint, ClientExecutor clientExecutor)
{
             final T result0 = ProxyFactory.create(clazz, target, clientExecutor);
             return (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class<?>[]
{ clazz }, new InvocationHandler() {
                 @Override
    -            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
    -                Object result1;
    +            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{                 
                     try {
    -                    result1 = method.invoke(result0, args);
    +                    Object result1 = method.invoke(result0, args);
    +                    Class<?> type = String.class;
    +                    if (result1 instanceof Response) {
    +                        if(((Response)result1).getStatus()/100 == 2) {
    +                           String responseClass = method.getAnnotation(ApiOperation.class).responseClass();
    --- End diff --
    
    @neykov That will fall back to String because it isn't a FQN


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message