Package org.apache.cxf.jaxrs.client

Examples of org.apache.cxf.jaxrs.client.WebClient.reset()


            if (resp.getStatus() == 404) {
              if (!retry) {
                return null;
              }
                if (null != client) {
                    client.reset();
                }
                switchServerURL(client.getBaseURI().toString());
                return saveObject(ctx, false);
            }
            return key;
View Full Code Here


            handleWebException(e);
        } catch (Exception e) {
            if (retry && (e instanceof ConnectException
                    || e instanceof ClientException)) {
                if (null != client) {
                    client.reset();
                }
                switchServerURL(client.getBaseURI().toString());
                return saveObject(ctx);
            }
            if (e instanceof RuntimeException) {
View Full Code Here

              throw (RuntimeException) e;
            }
            throw new IllegalStateException("Upload failed: ", e);
        } finally {
            if (null != client) {
                client.reset();
            }
        }
        return null;
    }
View Full Code Here

            handleWebException(e);
        } catch (Exception e) {
            if (retry && (e instanceof ConnectException
                    || e instanceof ClientException)) {
                if (null != client) {
                    client.reset();
                }
                switchServerURL(client.getBaseURI().toString());
                return lookupObject(contextKey, false);
            }
            if (e instanceof RuntimeException) {
View Full Code Here

              throw (RuntimeException) e;
            }
            throw new IllegalStateException("Lookup failed: ", e);
        } finally {
            if (null != client) {
                client.reset();
            }
        }

        return object;
    }
View Full Code Here

           handleWebException(e);
       } catch (Exception e) {
           if (retry && (e instanceof ConnectException
                   || e instanceof ClientException)) {
               if (null != client) {
                   client.reset();
               }
               switchServerURL(client.getBaseURI().toString());
               deleteObject(key, false);
           }
           if (e instanceof RuntimeException) {
View Full Code Here

             throw (RuntimeException) e;
           }
           throw new IllegalStateException("Delete failed: ", e);
       } finally {
           if (null != client) {
               client.reset();
           }
       }
   }

View Full Code Here

        wc.accept(MediaType.APPLICATION_XML);
        List<Person> persons = getPersons(wc);

        // Get individual persons using JSON
        System.out.println("Getting individual persons using JSON...");
        wc.reset().accept(MediaType.APPLICATION_JSON);
        for (Person person : persons) {
            // Move forward, for example, given that web client is currently
            // positioned at
            // personServiceURI and a current person id such as 4, wc.path(id)
            // will point
View Full Code Here

        // wc.reset() insures the current path is reset to the base
        // personServiceURI and
        // the headers which may have been set during the previous invocations
        // are also reset.
        wc.reset().accept(MediaType.APPLICATION_XML);
        wc.path("4");
        getPerson(wc);

        System.out.println("Getting info about Fred's mother");
        wc.path("mother");
View Full Code Here

        System.out.println("Getting info about Fred's partner");
        wc.back(false).path("partner");
        getPerson(wc);

        // Get info about Fred's ancestors, descendants and children
        wc.reset().accept(MediaType.APPLICATION_XML);
        wc.path("4");

        System.out.println("Getting info about Fred's ancestors");
        wc.path("ancestors");
        getPersons(wc);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.