brooklyn-dev mailing list archives

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

    https://github.com/apache/incubator-brooklyn/pull/690#discussion_r32534673
  
    --- Diff: usage/rest-client/src/main/java/brooklyn/rest/client/BrooklynApi.java ---
    @@ -116,22 +120,37 @@ 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) {
    +                        Response resp = (Response)result1;
    +                        if(HttpTool.isStatusCodeHealthy(resp.getStatus()) &&
method.isAnnotationPresent(ApiOperation.class)) {
    --- End diff --
    
    Is a healthy response the only case in which we care about the specific type?


---
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